跳转至

使用 Helm 部署NebulaGraph集群

历史版本兼容性

1.x 版本的 NebulaGraph Operator 不兼容 3.x 以下版本的NebulaGraph。

前提条件

创建NebulaGraph集群

  1. 添加 NebulaGraph Operator Helm 仓库

    helm repo add nebula-operator https://vesoft-inc.github.io/nebula-operator/charts
    
  2. 更新 Helm 仓库,拉取最新仓库资源。

    helm repo update
    
  3. 为安装集群所需的配置参数设置环境变量。

    export NEBULA_CLUSTER_NAME=nebula         #NebulaGraph集群的名字。
    export NEBULA_CLUSTER_NAMESPACE=nebula    #NebulaGraph集群所处的命名空间的名字。
    export STORAGE_CLASS_NAME=fast-disks             #NebulaGraph集群的 StorageClass。
    
  4. 为NebulaGraph集群创建命名空间(如已创建,略过此步)。

    kubectl create namespace "${NEBULA_CLUSTER_NAMESPACE}"
    
  5. 创建NebulaGraph集群。

    helm install "${NEBULA_CLUSTER_NAME}" nebula-operator/nebula-cluster \
        --namespace="${NEBULA_CLUSTER_NAMESPACE}" \
        --set nameOverride=${NEBULA_CLUSTER_NAME} \
        --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
        # 指定 NebulaGraph 集群的版本。
        --set nebula.version=v3.5.0 \
        # 指定 nebula-cluster chart 的版本,不指定则默认安装最新版本 chart。
        --version=1.5.0 
    
  6. 查看NebulaGraph集群创建状态。

    kubectl -n "${NEBULA_CLUSTER_NAMESPACE}" get pod -l "app.kubernetes.io/cluster=${NEBULA_CLUSTER_NAME}"
    

扩缩容集群

  • 不支持扩缩容社区版的NebulaGraph集群。

删除集群

使用 Helm 删除集群的命令如下:

helm uninstall "${NEBULA_CLUSTER_NAME}" --namespace="${NEBULA_CLUSTER_NAMESPACE}"

或者使用真实值删除集群,例如:

helm uninstall nebula --namespace=nebula

后续操作

连接NebulaGraph

NebulaGraph集群 Chart 配置参数说明

参数 默认值 描述
nameOverride nil 覆盖集群 Chart 的名称。
nebula.version v3.5.0 NebulaGraph的版本。
nebula.imagePullPolicy IfNotPresent NebulaGraph镜像的拉取策略。关于拉取策略详情,请参考 Image pull policy
nebula.storageClassName nil 持久存储卷的类型,默认使用 StorageClass 的名字。
nebula.schedulerName default-scheduler NebulaGraph集群的调度器。
nebula.reference {"name": "statefulsets.apps", "version": "v1"} 为NebulaGraph引用的工作负载。
nebula.graphd.image vesoft/nebula-graphd Graphd 容器镜像名称。使用 nebula.version中的值作为版本。
nebula.graphd.replicas 2 Graphd 服务的副本数。
nebula.graphd.env [] Graphd 服务的环境变量。
nebula.graphd.resources {"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} Graphd 资源配置。
nebula.graphd.logStorage 500Mi Graphd 服务的日志盘大小。
nebula.graphd.podLabels {} Graphd 服务 Pod 的标签。
nebula.graphd.podAnnotations {} Graphd 服务 Pod 的注解。
nebula.graphd.nodeSelector {} 为 Graphd pod 设置节点标签以分配至指定的节点中。
nebula.graphd.tolerations {} 为 Graphd pod 设置容忍度。
nebula.graphd.affinity {} 为 Graphd pod 设置亲和性。
nebula.graphd.readinessProbe {} 为 Graphd pod 设置就绪探针以检测容器的状态。
nebula.graphd.sidecarContainers {} 为 Graphd pod 设置 Sidecar Containers。
nebula.graphd.sidecarVolumes {} 为 Graphd pod 设置 Sidecar Volumes。
nebula.metad.image vesoft/nebula-metad Metad 容器镜像名称。使用 nebula.version中的值作为版本。
nebula.metad.replicas 3 Metad 服务的副本数。
nebula.metad.env [] Metad 服务的环境变量。
nebula.metad.resources {"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} Metad 服务的资源配置。
nebula.metad.logStorage 500Mi Metad 服务的日志盘大小。
nebula.metad.dataStorage 1Gi Metad 服务的数据盘大小。
nebula.metad.license {} 创建企业版NebulaGraph集群所需的 License 配置。
nebula.metad.podLabels {} Metad 服务 Pod 的标签。
nebula.metad.podAnnotations {} Metad 服务 Pod 的注解。
nebula.metad.nodeSelector {} 为 Metad pod 设置节点标签以分配至指定的节点中。
nebula.metad.tolerations {} 为 Metad pod 设置容忍度。
nebula.metad.affinity {} 为 Metad pod 设置亲和性。
nebula.metad.readinessProbe {} 为 Metad pod 设置就绪探针以检测容器的状态。
nebula.metad.sidecarContainers {} 为 Metad pod 设置 Sidecar Containers。
nebula.metad.sidecarVolumes {} 为 Metad pod 设置 Sidecar Volumes。
nebula.storaged.image vesoft/nebula-storaged Storaged 容器镜像名称。使用 nebula.version中的值作为版本。
nebula.storaged.replicas 3 Storaged 服务的副本数。
nebula.storaged.env [] Storaged 服务的环境变量。
nebula.storaged.resources {"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} Storaged 服务的资源配置。
nebula.storaged.logStorage 500Mi Storaged 服务的日志盘大小。
nebula.storaged.dataStorage 1Gi Storaged 服务的数据盘大小。
nebula.storaged.podLabels {} Storaged 服务 Pod 的标签。
nebula.storaged.podAnnotations {} Storaged 服务 Pod 的注解。
nebula.storaged.nodeSelector {} 为 Storaged pod 设置节点标签以分配至指定的节点中。
nebula.storaged.tolerations {} 为 Storaged pod 设置容忍度。
nebula.storaged.affinity {} 为 Storaged pod 设置亲和性。
nebula.storaged.readinessProbe {} 为 Storaged pod 设置就绪探针以检测容器的状态。
nebula.storaged.sidecarContainers {} 为 Storaged pod 设置 Sidecar Containers。
nebula.storaged.sidecarVolumes {} 为 Storaged Pod 设置 Sidecar Volumes。
imagePullSecrets [] 拉取镜像的 Secret。

最后更新: May 25, 2023