Skip to content

Deploy NebulaGraph Operator

You can deploy NebulaGraph Operator with Helm.

Background

NebulaGraph Operator automates the management of NebulaGraph clusters, and eliminates the need for you to install, scale, upgrade, and uninstall NebulaGraph clusters, which lightens the burden on managing different application versions.

Prerequisites

Before installing NebulaGraph Operator, you need to install the following software and ensure the correct version of the software :

Software Requirement
Kubernetes >= 1.16
Helm >= 3.2.0
CoreDNS >= 1.6.0

Note

  • If using a role-based access control policy, you need to enable RBAC (optional).
  • CoreDNS is a flexible and scalable DNS server that is installed for Pods in NebulaGraph clusters.

Steps

Install NebulaGraph Operator

  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 repositories.

    helm repo update
    

    For more information about helm repo, see Helm Repo.

  3. Create a namespace for NebulaGraph Operator.

    kubectl create namespace <namespace_name>
    

    For example, run the following command to create a namespace named nebula-operator-system.

    kubectl create namespace nebula-operator-system
    
    • All the resources of NebulaGraph Operator are deployed in this namespace.
    • You can also use a different name.
  4. Install NebulaGraph Operator.

    helm install nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> --version=${chart_version}
    

    For example, the command to install NebulaGraph Operator of version 1.6.2 is as follows.

    helm install nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=1.6.2
    
    • nebula-operator-system is a user-created namespace name. If you have not created this namespace, run kubectl create namespace nebula-operator-system to create one. You can also use a different name.
    • 1.6.2 is the version of the nebula-operator chart. When not specifying --version, the latest version of the nebula-operator chart is used by default. Run helm search repo -l nebula-operator to see chart versions.

    You can customize the configuration items of the NebulaGraph Operator chart before running the installation command. For more information, see Customize Helm charts below.

Customize Helm charts

When executing the helm install [NAME] [CHART] [flags] command to install a chart, you can specify the chart configuration. For more information, see Customizing the Chart Before Installing.

View the related configuration options in the nebula-operator chart configuration file.

Alternatively, you can view the configurable options through the command helm show values nebula-operator/nebula-operator, as shown below.

For example:

[k8s@master ~]$ helm show values nebula-operator/nebula-operator
image:
  nebulaOperator:
    image: vesoft/nebula-operator:v1.6.2
    imagePullPolicy: Always
  kubeRBACProxy:
    image: bitnami/kube-rbac-proxy:0.14.2
    imagePullPolicy: Always
  kubeScheduler:
    image: registry.k8s.io/kube-scheduler:v1.24.11
    imagePullPolicy: Always

imagePullSecrets: []
kubernetesClusterDomain: ""

controllerManager:
  create: true
  replicas: 2
  env: []
  resources:
    limits:
      cpu: 200m
      memory: 200Mi
    requests:
      cpu: 100m
      memory: 100Mi

admissionWebhook:
  create: false

scheduler:
  create: true
  schedulerName: nebula-scheduler
  replicas: 2
  env: []
  resources:
    limits:
      cpu: 200m
      memory: 20Mi
    requests:
      cpu: 100m
      memory: 100Mi

Part of the above parameters are described as follows:

Parameter Default value Description
image.nebulaOperator.image vesoft/nebula-operator:v1.6.2 The image of NebulaGraph Operator, version of which is 1.6.2.
image.nebulaOperator.imagePullPolicy IfNotPresent The image pull policy in Kubernetes.
imagePullSecrets - The image pull secret in Kubernetes.
kubernetesClusterDomain cluster.local The cluster domain.
controllerManager.create true Whether to enable the controller-manager component.
controllerManager.replicas 2 The numeric value of controller-manager replicas.
admissionWebhook.create false Whether to enable Admission Webhook. This option is disabled. To enable it, set the value to true and you will need to install cert-manager.
shceduler.create true Whether to enable Scheduler.
shceduler.schedulerName nebula-scheduler The Scheduler name.
shceduler.replicas 2 The numeric value of nebula-scheduler replicas.

You can run helm install [NAME] [CHART] [flags] to specify chart configurations when installing a chart. For more information, see Customizing the Chart Before Installing.

The following example shows how to specify the NebulaGraph Operator's AdmissionWebhook mechanism to be turned on when you install NebulaGraph Operator (AdmissionWebhook is disabled by default):

helm install nebula-operator nebula-operator/nebula-operator --namespace=<nebula-operator-system> --set admissionWebhook.create=true

For more information about helm install, see Helm Install.

Update NebulaGraph Operator

  1. Update the information of available charts locally from chart repositories.

    helm repo update
    
  2. Update NebulaGraph Operator by passing configuration parameters via --set.

    • --set:Overrides values using the command line. For configurable items, see the above-mentioned section Customize Helm charts.

    For example, to enable the AdmissionWebhook, run the following command:

    helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=1.6.2 --set admissionWebhook.create=true
    

    For more information, see Helm upgrade.

Upgrade NebulaGraph Operator

Legacy version compatibility

  • Does not support upgrading 0.9.0 and below version NebulaGraph Operator to 1.x.
  • The 1.x version NebulaGraph Operator is not compatible with NebulaGraph of version below v3.x.
  1. Update the information of available charts locally from chart repositories.

    helm repo update
    
  2. Upgrade Operator to v1.6.2.

    helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> --version=1.6.2
    

    For example:

    helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=1.6.2
    

    Output:

    Release "nebula-operator" has been upgraded. Happy Helming!
    NAME: nebula-operator
    LAST DEPLOYED: Tue Apr 16 02:21:08 2022
    NAMESPACE: nebula-operator-system
    STATUS: deployed
    REVISION: 3
    TEST SUITE: None
    NOTES:
    NebulaGraph Operator installed!
    
  3. Pull the latest CRD configuration file.

    Note

    You need to upgrade the corresponding CRD configurations after NebulaGraph Operator is upgraded. Otherwise, the creation of NebulaGraph clusters will fail. For information about the CRD configurations, see apps.nebula-graph.io_nebulaclusters.yaml.

    1. Pull the NebulaGraph Operator chart package.

      helm pull nebula-operator/nebula-operator --version=1.6.2
      
      • --version: The NebulaGraph Operator version you want to upgrade to. If not specified, the latest version will be pulled.
    2. Run tar -zxvf to unpack the charts.

      For example: To unpack v1.6.2 chart to the /tmp path, run the following command:

      tar -zxvf nebula-operator-1.6.2.tgz -C /tmp
      
      • -C /tmp: If not specified, the chart files will be unpacked to the current directory.
  4. Upgrade the CRD configuration file in the nebula-operator directory.

    kubectl apply -f crds/nebulacluster.yaml
    

    Output:

    customresourcedefinition.apiextensions.k8s.io/nebulaclusters.apps.nebula-graph.io configured
    

Uninstall NebulaGraph Operator

  1. Uninstall the NebulaGraph Operator chart.

    helm uninstall nebula-operator --namespace=<nebula-operator-system>
    
  2. Delete CRD.

    kubectl delete crd nebulaclusters.apps.nebula-graph.io
    

What's next

Automate the deployment of NebulaGraph clusters with NebulaGraph Operator. For more information, see Deploy NebulaGraph Clusters with Kubectl or Deploy NebulaGraph Clusters with Helm.

For the NebulaGraph Enterprise Edition deployment, you need first to deploy the License Manager and have the license key loaded. For more information, see Deploy LM.


Last update: July 31, 2023