Skip to content

Deploy NebulaGraph clusters with Helm

Legacy version compatibility

The 1.x version NebulaGraph Operator is not compatible with NebulaGraph of version below v3.x.

Prerequisite

Create clusters

  1. Add the NebulaGraph Operator Helm repository.

    helm repo add nebula-operator https://vesoft-inc.github.io/nebula-operator/charts
    
  2. Update information of available charts locally from chart repositories.

    helm repo update
    
  3. Set environment variables to your desired values.

    export NEBULA_CLUSTER_NAME=nebula         # The desired NebulaGraph cluster name.
    export NEBULA_CLUSTER_NAMESPACE=nebula    # The desired namespace where your NebulaGraph cluster locates.
    export STORAGE_CLASS_NAME=fast-disks             # The name of the StorageClass that has been created.
    
  4. Create a namespace for your NebulaGraph cluster (If you have created one, skip this step).

    kubectl create namespace "${NEBULA_CLUSTER_NAMESPACE}"
    
  5. Create a Secret for pulling the NebulaGraph cluster image from a private repository (Enterprise only).

    kubectl -n "${NEBULA_CLUSTER_NAMESPACE}" create secret docker-registry <image-pull-secret> \
    --docker-server=DOCKER_REGISTRY_SERVER \
    --docker-username=DOCKER_USER \
    --docker-password=DOCKER_PASSWORD
    
    • <image-pull-secret>: Specify the name of the Secret.
    • DOCKER_REGISTRY_SERVER: Specify the server address of the private repository from which the image will be pulled, such as reg.example-inc.com.
    • DOCKER_USER: The username for the image repository.
    • DOCKER_PASSWORD: The password for the image repository.
  6. Apply the variables to the Helm chart to create a NebulaGraph cluster.

    helm install "${NEBULA_CLUSTER_NAME}" nebula-operator/nebula-cluster \
        --set nameOverride=${NEBULA_CLUSTER_NAME} \
        --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
        # Specify the version of the NebulaGraph cluster. 
        --set nebula.version=v3.5.0 \  
        # Specify the version of the nebula-cluster chart. If not specified, the latest version of the chart is installed by default.  
        # Run 'helm search repo nebula-operator/nebula-cluster' to view the available versions of the chart.   
        --version=1.6.2 
        --namespace="${NEBULA_CLUSTER_NAMESPACE}" \
    

    Enterpriseonly

    For NebulaGraph Enterprise, run the following command to create a NebulaGraph cluster:

    helm install "${NEBULA_CLUSTER_NAME}" nebula-operator/nebula-cluster \
        # Configure the access address and port (default port is '9119') that points to the LM. You must configure this parameter in order to obtain the license information. Only for NebulaGraph Enterprise Edition clusters.
        --set nebula.metad.licenseManagerURL=`192.168.8.XXX:9119` \
        # Configure the image addresses for each service in the cluster.
        --set nebula.graphd.image=<reg.example-inc.com/test/graphd-ent> \
        --set nebula.metad.image=<reg.example-inc.com/test/metad-ent> \
        --set nebula.storaged.image=<reg.example-inc.com/test/storaged-ent> \
        # Configure the Secret for pulling images from a private repository.
        --set nebula.imagePullSecrets=<image-pull-secret> \
        --set nameOverride=${NEBULA_CLUSTER_NAME} \
        --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
        # Specify the version of the NebulaGraph cluster. 
        --set nebula.version=v3.5.0 \  
        # Specify the version of the nebula-cluster chart. If not specified, the latest version of the chart is installed by default.
        # Run 'helm search repo nebula-operator/nebula-cluster' to view the available versions of the chart.     
        --version=1.6.2 
        --namespace="${NEBULA_CLUSTER_NAMESPACE}" \
    

    To view all configuration parameters of the NebulaGraph cluster, run the helm show values nebula-operator/nebula-cluster command or click nebula-cluster/values.yaml.

    Click Chart parameters to see descriptions and default values of the configurable cluster parameters.

    Use the --set argument to set configuration parameters for the cluster. For example, --set nebula.storaged.replicas=3 will set the number of replicas for the Storage service in the cluster to 3.

  7. Check the status of the NebulaGraph cluster you created.

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

    Output:

    NAME                READY   STATUS    RESTARTS   AGE
    nebula-graphd-0     1/1     Running   0          5m34s
    nebula-graphd-1     1/1     Running   0          5m34s
    nebula-metad-0      1/1     Running   0          5m34s
    nebula-metad-1      1/1     Running   0          5m34s
    nebula-metad-2      1/1     Running   0          5m34s
    nebula-storaged-0   1/1     Running   0          5m34s
    nebula-storaged-1   1/1     Running   0          5m34s
    nebula-storaged-2   1/1     Running   0          5m34s
    

Scaling clusters

  • The cluster scaling feature is for NebulaGraph Enterprise Edition only.
  • Scaling a NebulaGraph cluster for Enterprise Edition is supported only with NebulaGraph Operator version 1.1.0 or later.

You can scale a NebulaGraph cluster by defining the value of the replicas corresponding to the different services in the cluster.

For example, run the following command to scale out a NebulaGraph cluster by changing the number of Storage services from 2 (the original value) to 5:

helm upgrade "${NEBULA_CLUSTER_NAME}" nebula-operator/nebula-cluster \
    --namespace="${NEBULA_CLUSTER_NAMESPACE}" \
    --set nameOverride=${NEBULA_CLUSTER_NAME} \
    --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
    --set nebula.storaged.replicas=5

Similarly, you can scale in a NebulaGraph cluster by setting the value of the replicas corresponding to the different services in the cluster smaller than the original value.

Caution

NebulaGraph Operator currently only supports scaling Graph and Storage services and does not support scale Meta services.

You can click on nebula-cluster/values.yaml to see more configurable parameters of the nebula-cluster chart. For more information about the descriptions of configurable parameters, see Configuration parameters of the nebula-cluster Helm chart below.

Delete clusters

Run the following command to delete a NebulaGraph cluster with Helm:

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

Or use variable values to delete a NebulaGraph cluster with Helm:

helm uninstall nebula --namespace=nebula

What's next

Connect to NebulaGraph Databases


Last update: August 15, 2023