部署成功后无法用nebula console访问

部署方式:本地minikube自建k8s集群,版本1.23 使用helm部署
参考文档:使用 Helm 部署NebulaGraph集群 - NebulaGraph Database 手册

k8s版本:

Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-12T14:18:45Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.0", GitCommit:"ab69524f795c42094a6630298ff53f3c3ebab7f4", GitTreeState:"clean", BuildDate:"2021-12-07T18:09:57Z", GoVersion:"go1.17.3", Compiler:"gc", Platform:"linux/amd64"}

pod状态:

service状态:

连接命令:
kubectl run -ti --image vesoft/nebula-console:v3.5.0 --restart=Never – nebula-console -addr 10.105.13.150 -port 9669 -u root -p vesoft

报错信息:
If you don’t see a command prompt, try pressing enter.
2023/10/08 02:23:41 Fail to initialize the connection pool, host: 10.105.13.150, port: 9669, failed to open connection, error: failed to open transport, error: dial tcp 10.105.13.150:9669: connect: connection refused
panic: Fail to initialize the connection pool, host: 10.105.13.150, port: 9669, failed to open connection, error: failed to open transport, error: dial tcp 10.105.13.150:9669: connect: connection refused

service配置,与帮助文档少了spec.externalTrafficPolicy,原因是加上这个版本的k8s在type是ClusterIP时不支持externalTrafficPolicy

apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/cluster: nebula
    app.kubernetes.io/component: graphd
    app.kubernetes.io/managed-by: nebula-operator
    app.kubernetes.io/name: nebula-graph
  name: nebula-graphd-svc
  namespace: default
spec:
  ports:
  - name: thrift
    port: 9669
    protocol: TCP
    targetPort: 9669
  - name: http
    port: 19669
    protocol: TCP
    targetPort: 19669
  selector:
    app.kubernetes.io/cluster: nebula
    app.kubernetes.io/component: graphd
    app.kubernetes.io/managed-by: nebula-operator
    app.kubernetes.io/name: nebula-graph
  type: ClusterIP

storage用的是minikube提供的默认的standard

更换了个集群IP可以了,使用这个命令 kubectl get service -l app.kubernetes.io/cluster=nebula
看到的集群IP不是真正的集群IP

在dashboard中找到了真正的集群IP是10.111.0.163

后面研究一下是怎么回事

大概原因是之前没有创建service的时候没有指定namespace,导致在默认的namespace中创建了,service不能跨namespace访问

2 个赞

此话题已在最后回复的 7 天后被自动关闭。不再允许新回复。