Skip to content

Deploy NebulaGraph clusters with Kubectl

Legacy version compatibility

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

Prerequisites

Create clusters

The following example shows how to create a NebulaGraph cluster by creating a cluster named nebula.

  1. Create a file named apps_v1alpha1_nebulacluster.yaml.

    • For a NebulaGraph Community cluster

      Create a file named apps_v1alpha1_nebulacluster.yaml. For the file content, see the sample configuration.

      The parameters in the file are described as follows:

      Parameter Default value Description
      metadata.name - The name of the created NebulaGraph cluster.
      spec.graphd.replicas 1 The numeric value of replicas of the Graphd service.
      spec.graphd.images vesoft/nebula-graphd The container image of the Graphd service.
      spec.graphd.version v3.5.0 The version of the Graphd service.
      spec.graphd.service - The Service configurations for the Graphd service.
      spec.graphd.logVolumeClaim.storageClassName - The log disk storage configurations for the Graphd service.
      spec.metad.replicas 1 The numeric value of replicas of the Metad service.
      spec.metad.images vesoft/nebula-metad The container image of the Metad service.
      spec.metad.version v3.5.0 The version of the Metad service.
      spec.metad.dataVolumeClaim.storageClassName - The data disk storage configurations for the Metad service.
      spec.metad.logVolumeClaim.storageClassName - The log disk storage configurations for the Metad service.
      spec.storaged.replicas 3 The numeric value of replicas of the Storaged service.
      spec.storaged.images vesoft/nebula-storaged The container image of the Storaged service.
      spec.storaged.version v3.5.0 The version of the Storaged service.
      spec.storaged.dataVolumeClaims.resources.requests.storage - Data disk storage size for the Storaged service. You can specify multiple data disks to store data. When multiple disks are specified, the storage path is /usr/local/nebula/data1, /usr/local/nebula/data2, etc.
      spec.storaged.dataVolumeClaims.resources.storageClassName - The data disk storage configurations for Storaged. If not specified, the global storage parameter is applied.
      spec.storaged.logVolumeClaim.storageClassName - The log disk storage configurations for the Storaged service.
      spec.storaged.enableAutoBalance true Whether to balance data automatically.
      spec.reference.name - The name of the dependent controller.
      spec.schedulerName - The scheduler name.
      spec.imagePullPolicy The image policy to pull the NebulaGraph image. For details, see Image pull policy. The image pull policy in Kubernetes.
      spec.logRotate - Log rotation configuration. For more information, see Manage cluster logs.
      spec.enablePVReclaim false Define whether to automatically delete PVCs and release data after deleting the cluster. For more information, see Reclaim PVs.
  2. Create a NebulaGraph cluster.

    kubectl create -f apps_v1alpha1_nebulacluster.yaml
    

    Output:

    nebulacluster.apps.nebula-graph.io/nebula created
    
  3. Check the status of the NebulaGraph cluster.

    kubectl get nebulaclusters.apps.nebula-graph.io nebula
    

    Output:

    NAME     GRAPHD-DESIRED   GRAPHD-READY   METAD-DESIRED   METAD-READY   STORAGED-DESIRED   STORAGED-READY   AGE
    nebula   1                1              1               1             3                  3                86s
    

Scaling clusters

  • The cluster scaling feature is for NebulaGraph Enterprise Edition only.

Delete clusters

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

kubectl delete -f apps_v1alpha1_nebulacluster.yaml

What's next

Connect to NebulaGraph databases


Last update: April 19, 2023