Deploy Nebula Graph clusters with Helm¶
Prerequisite¶
Create clusters¶
-
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
-
Update information of available charts locally from chart repositories.
helm repo update
-
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.
-
Create a namespace for your Nebula Graph cluster(If you have created one, skip this step).
kubectl create namespace "${NEBULA_CLUSTER_NAMESPACE}"
-
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}"
-
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.6.0 |
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.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 the Graphd service. |
nebula.graphd.env |
[] |
The environment variables for the Graphd service. |
nebula.graphd.resources |
{"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} |
The resource configurations for the Graphd service. |
nebula.graphd.logStorage |
500Mi |
The log disk storage capacity for the Graphd service. |
nebula.graphd.podLabels |
{} |
Labels for the Graphd pod in a Nebula Graph cluster. |
nebula.graphd.podAnnotations |
{} |
Pod annotations for the Graphd pod in a Nebula Graph cluster. |
nebula.graphd.nodeSelector |
{} |
Labels for the Graphd pod to be scheduled to the specified node. |
nebula.graphd.tolerations |
{} |
Tolerations for the Graphd pod. |
nebula.graphd.affinity |
{} |
Affinity for the Graphd pod. |
nebula.graphd.readinessProbe |
{} |
ReadinessProbe for the Graphd pod. |
nebula.graphd.sidecarContainers |
{} |
Sidecar containers for the Graphd pod. |
nebula.graphd.sidecarVolumes |
{} |
Sidecar volumes for the Graphd pod. |
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 the Metad service. |
nebula.metad.env |
[] |
The environment variables for the Metad service. |
nebula.metad.resources |
{"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}} |
The resource configurations for the Metad service. |
nebula.metad.logStorage |
500Mi |
The log disk capacity for the Metad service. |
nebula.metad.dataStorage |
1Gi |
The data disk capacity for the Metad service. |
nebula.metad.podLabels |
{} |
Labels for the Metad pod in a Nebula Graph cluster. |
nebula.metad.podAnnotations |
{} |
Pod annotations for the Metad pod in a Nebula Graph cluster. |
nebula.metad.nodeSelector |
{} |
Labels for the Metad pod to be scheduled to the specified node. |
nebula.metad.tolerations |
{} |
Tolerations for the Metad pod. |
nebula.metad.affinity |
{} |
Affinity for the Metad pod. |
nebula.metad.readinessProbe |
{} |
ReadinessProbe for the Metad pod. |
nebula.metad.sidecarContainers |
{} |
Sidecar containers for the Metad pod. |
nebula.metad.sidecarVolumes |
{} |
Sidecar volumes for the Metad pod. |
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.logStorage |
500Mi |
The log disk capacity for the Metad service. |
nebula.storaged.dataStorage |
1Gi |
The data disk capacity for the Metad service. |
nebula.storaged.podLabels |
{} |
Labels for the Metad pod in a Nebula Graph cluster. |
nebula.storaged.podAnnotations |
{} |
Pod annotations for the Metad pod in a Nebula Graph cluster. |
nebula.storaged.nodeSelector |
{} |
Labels for the Metad pod to be scheduled to the specified node. |
nebula.storaged.tolerations |
{} |
Tolerations for the Metad pod. |
nebula.storaged.affinity |
{} |
Affinity for the Metad pod. |
nebula.storaged.readinessProbe |
{} |
ReadinessProbe for the Metad pod. |
nebula.storaged.sidecarContainers |
{} |
Sidecar containers for the Metad pod. |
nebula.storaged.sidecarVolumes |
{} |
Sidecar volumes for the Metad pod. |
imagePullSecrets |
[] |
The Secret to pull the Nebula Graph cluster image. |