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¶
-
You have prepared the license file for NebulaGraph Enterprise Edition clusters.
Enterpriseonly
The license file is required only when creating a NebulaGraph Enterprise Edition cluster.
Create clusters¶
-
Add the NebulaGraph 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 NebulaGraph cluster name. export NEBULA_CLUSTER_NAMESPACE=nebula # The desired namespace where your NebulaGraph cluster locates. export STORAGE_CLASS_NAME=fast-disks # The desired StorageClass name in your NebulaGraph cluster.
-
Create a namespace for your NebulaGraph cluster (If you have created one, skip this step).
kubectl create namespace "${NEBULA_CLUSTER_NAMESPACE}"
-
Configure the license for the Enterprise Edition cluster.
Enterpriseonly
- This step is required only for creating a NebulaGraph Grpah Enterprise Edition cluster.
- Ignore this step if you are creating a NebulaGraph Community Edition cluster.
kubectl create secret generic nebula-license --from-file=nebula.license
To check the details of the license, run the following command:
kubectl get secrets nebula-license -o yaml
-
Apply the variables to the Helm chart to create a NebulaGraph 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}"
Enterpriseonly
You must add
--set nebula.metad.license.secretName=nebula-license
and--set nebula.metad.license.licenseKey=nebula.license
when creating a NebulaGraph Enterprise Edition cluster. -
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
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 |
v3.4.0 |
The version of NebulaGraph. |
nebula.imagePullPolicy |
IfNotPresent |
The NebulaGraph 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 NebulaGraph cluster. |
nebula.reference |
{"name": "statefulsets.apps", "version": "v1"} |
The workload referenced for a NebulaGraph 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 NebulaGraph cluster. |
nebula.graphd.podAnnotations |
{} |
Pod annotations for the Graphd pod in a NebulaGraph 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.license |
{} |
The license configurations for creating a NebulaGraph Enterprise Edition cluster. |
nebula.metad.podLabels |
{} |
Labels for the Metad pod in a NebulaGraph cluster. |
nebula.metad.podAnnotations |
{} |
Pod annotations for the Metad pod in a NebulaGraph 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 NebulaGraph cluster. |
nebula.storaged.podAnnotations |
{} |
Pod annotations for the Metad pod in a NebulaGraph 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 NebulaGraph cluster image. |