关于k8s安装nebula集群的问题

提问参考模版:

  • nebula 版本:3.3.0
  • 部署方式:nebula集群
  • 安装方式:k8s /docker
  • 是否上生产环境:Y
  • 问题的具体描述
    使用官方提供的3.3.0版本的docker镜像,k8s的配置文件如下(以metad为例):
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: nebula-metad
  labels:
    app: nebula-metad
spec:
  serviceName: nebula-metad
  replicas: 2
  selector:
    matchLabels:
      app: nebula-metad
  template:
    metadata:
      labels:
        app: nebula-metad
    spec:
      containers:
        - name: nebula-metad
          image: xxx.com/nebula-metad:v3.3.0-arm64
          command: [ "/bin/bash", "-ecx" ]
          args: [ "exec /usr/local/nebula/bin/nebula-metad --flagfile=/usr/local/nebula/etc/nebula-metad.conf --daemonize=false --local_ip=$(hostname).nebula-metad.default.svc.cluster.local"]
          ports:
            - name: thrift
              containerPort: 9559
            - name: http
              containerPort: 19559
            - name: http2
              containerPort: 19560
          volumeMounts:
            - name: config
              mountPath: /usr/local/nebula/etc/
            - name: timezone
              mountPath: /etc/localtime
            - name: data
              mountPath: /usr/local/nebula/data
      imagePullSecrets:
        - name: registry-key-power
      volumes:
        - name: timezone
          hostPath:
            path: /etc/localtime
        - name: config
          configMap:
            name: nebula-metad
  volumeClaimTemplates:
    - metadata:
        name: data
        annotations:
          volume.beta.kubernetes.io/storage-class: "managed-nfs-storage"
      spec:
        accessModes: [ "ReadWriteMany" ]
        resources:
          requests:
            storage: 2Gi

问题:启动命令里的–local_ip项必须写全限定域名才能启动,写成$(hostname).nebula-metad 则启动失败,导致在configmap中配置nebula所有配置文件中的 --meta_server_addrs 项也必须写全限定域名,很不方便,这个有什么解决办法吗,上述–local_ip 是必须写全限定域名吗

您好,在k8s环境推荐使用operator部署,安装 NebulaGraph Operator - NebulaGraph Database 手册 ,operator会自动处理,就不需要关心域名配置了

1 个赞

这种方式在生产不支持,我看到他有要求装一些依赖

具体是哪里不支持呢,部分依赖是可以不装的

没有helm,内网环境

可以试试yaml部署,还是建议使用operator,之后的运维管理会方便很多

我这里用的就是yaml部署,问题就是那个域名问题,官网镜像是否要求必须是全限定域名呢?

嗯嗯,我前面的意思是用yaml部署operator。目前是必须用全限定域名的,如果用裸的statefulset部署的话,解决了域名问题,还会有add hosts等问题需要手动解决,所以建议先安装operator,operator会自动处理这些问题

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