Skip to content

Deploy Nebula Graph clusters with Helm

Prerequisite

Install Nebula Operator

Create clusters

  1. Add the Nebula Operator chart repository to Helm(If you have already added the chart, skip the 1-2 steps and start from step 3).

    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 Nebula Graph cluster name.
    export NEBULA_CLUSTER_NAMESPACE=nebula    # The desired namespace where your Nebula Graph cluster locates.
    export STORAGE_CLASS_NAME=gp2             # The desired StorageClass name in your Nebula Graph cluster.
    
  4. Create a namespace for your Nebula Graph cluster(If you have created one, skip this step).

    kubectl create namespace "${NEBULA_CLUSTER_NAMESPACE}"
    
  5. Apply the variables to the Helm chart to create a Nebula Graph cluster.

    helm install "${NEBULA_CLUSTER_NAME}" nebula-operator/nebula-cluster \
        --namespace="${NEBULA_CLUSTER_NAMESPACE}" \
        --set nameOverride=${NEBULA_CLUSTER_NAME} \
        --set nebula.storageClassName="${STORAGE_CLASS_NAME}"
    
  6. Check the status of the Nebula Graph 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

You can scale a Nebula Graph 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 Nebula Graph 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 Nebula Graph cluster by setting the value of the replicas corresponding to the different services in the cluster smaller than the original value.

Caution

Nebula 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 Nebula Graph cluster with Helm:

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

What's next

Connect to Nebula Graph Databases

Configuration parameters of the nebula-cluster Helm chart

Parameter Default value Description
nameOverride nil Replaces the name of the chart in the Chart.yaml file.
nebula.version v2.5.1 The version of Nebula Graph.
nebula.imagePullPolicy IfNotPresent The Nebula Graph image pull policy. For details, see Image pull policy.
nebula.storageClassName nil The StorageClass name. StorageClass is the default persistent volume type.
nebula.schedulerName default-scheduler The scheduler name of a Nebula Graph cluster.
nebula.reference {"name": "statefulsets.apps", "version": "v1"} The workload referenced for a Nebula Graph cluster.
nebula.podLabels {} Labels for pods in a Nebula Graph cluster.
nebula.podAnnotations {} Pod annotations in a Nebula Graph cluster.
nebula.graphd.image vesoft/nebula-graphd The image name for a Graphd service. Uses the value of nebula.version as its version.
nebula.graphd.replicas 2 The number of Graphd services.
nebula.graphd.env [] The environment variables for Graphd services.
nebula.graphd.resources {"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} The resource configurations for Graphd services.
nebula.graphd.storage 1Gi The storage capacity for Graphd services.
nebula.metad.image vesoft/nebula-metad The image name for a Metad service. Uses the value of nebula.version as its version.
nebula.metad.replicas 3 The number of Metad services.
nebula.metad.env [] The environment variables for Metad services.
nebula.metad.resources {"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} The resource configurations for Metad services.
nebula.metad.storage 1Gi The storage capacity for Metad services.
nebula.storaged.image vesoft/nebula-storaged The image name for a Storaged service. Uses the value of nebula.version as its version.
nebula.storaged.replicas 3 The number of Storaged services.
nebula.storaged.env [] The environment variables for Storaged services.
nebula.storaged.resources {"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} The resource configurations for Storagedss services.
nebula.storaged.storage 1Gi The storage capacity for Storaged services.
imagePullSecrets [] The Secret to pull the Nebula Graph cluster image.

Last update: September 30, 2021
Back to top