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 chart repository to Helm.

    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
    

    For more information about helm repo, see Helm Repo.

  3. 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.4.0 is as follows.

    helm install nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=1.4.0
    
    • 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.4.0 is the version of the NebulaGraph Operator chart. It can be unspecified when there is only one chart version in the NebulaGraph Operator chart repository. 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

Run helm show values [CHART] [flags] to see configurable options.

For example:

[k8s@master ~]$ helm show values nebula-operator/nebula-operator
image:
  nebulaOperator:
    image: vesoft/nebula-operator:v1.4.0
    imagePullPolicy: Always
  kubeRBACProxy:
    image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
    imagePullPolicy: Always
  kubeScheduler:
    image: k8s.gcr.io/kube-scheduler:v1.18.8
    imagePullPolicy: Always

imagePullSecrets: []
kubernetesClusterDomain: ""

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

admissionWebhook:
  create: true

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.4.0 The image of NebulaGraph Operator, version of which is 1.4.0.
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 true Whether to enable Admission Webhook.
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 off when you install NebulaGraph Operator (AdmissionWebhook is enabled by default):

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

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 or -values flag.

    • --set:Overrides values using the command line.
    • --values (or -f):Overrides values using YAML files.

    For configurable items, see the above-mentioned section Customize Helm charts.

    For example, to disable the AdmissionWebhook ( AdmissionWebhook is enabled by default), run the following command:

    helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=1.4.0 --set admissionWebhook.create=false
    

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

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

    For example:

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

    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.4.0
      
      • --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.4.0 chart to the /tmp path, run the following command:

      tar -zxvf nebula-operator-1.4.0.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.


Last update: February 19, 2024