gpt4 book ai didi

neo4j - 使用Kubernetes Ingress公开Neo4j Bolt

转载 作者:行者123 更新时间:2023-12-02 11:35:22 25 4
gpt4 key购买 nike

我正在尝试为某些培训构建Neo4j学习工具。我想使用Kubernetes为每个参与者使用Neo4j Pod。目前,我很难使用Ingress公开bolt端点,但我不知道为什么。
这是我的部署配置:

apiVersion: apps/v1
kind: Deployment
metadata:
name: neo4j
namespace: learn
labels:
app: neo-manager
type: database
spec:
replicas: 1
selector:
matchLabels:
app: neo-manager
type: database
template:
metadata:
labels:
app: neo-manager
type: database
spec:
containers:
- name: neo4j
imagePullPolicy: IfNotPresent
image: neo4j:3.5.6
ports:
- containerPort: 7474
- containerPort: 7687
protocol: TCP
---
kind: Service
apiVersion: v1
metadata:
name: neo4j-service
namespace: learn
labels:
app: neo-manager
type: database
spec:
selector:
app: neo-manager
type: database
ports:
- port: 7687
targetPort: 7687
name: bolt
protocol: TCP
- port: 7474
targetPort: 7474
name: client
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: neo4j-ingress
namespace: learn
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: learn.neo4j.com
http:
paths:
- path: /
backend:
serviceName: neo4j-service
servicePort: 7474
---
kind: ConfigMap
apiVersion: v1
metadata:
name: tcp-services
namespace: learn
data:
7687: "learn/neo4j-service:7687"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-ingress-controller
namespace: learn
spec:
replicas: 1
selector:
matchLabels:
app: ingress-nginx
template:
metadata:
labels:
app: ingress-nginx
spec:
containers:
- name: nginx-ingress-controller
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.9.0-beta.16
args:
- /nginx-ingress-controller
- --tcp-services-configmap=${POD_NAMESPACE}/tcp-services
env:
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace

客户端暴露得很好,它可以在 learn.neo4j.com下访问,但是我不知道在哪里指向它使用 bolt 连接到数据库。无论我如何尝试,都无法说出 ServiceUnavailable: Websocket Connection failure(控制台中的 WebSocket network error: The operation couldn’t be completed. Connection refused)。
我想念什么?

最佳答案

默认情况下,它会自动尝试连接到端口7687-如果您输入连接URL http://learn.neo4j.bolt.com:80(或https),它将正常工作。

关于neo4j - 使用Kubernetes Ingress公开Neo4j Bolt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56618099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com