Skip to content

Deploy Nebula Operator

You can deploy Nebula Operator with Helm.

Background

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

Prerequisites

Install software

Before installing Nebula 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
CertManager >= 1.2.0
OpenKruise >= 0.8.0

If using a role-based access control policy, you need to enable RBAC (optional).

Description of software

Note

The following software used by Nebula Operator is from the third party. Nebula Operator is not responsible for any problems that may arise during the software installation.

  • CoreDNS

    CoreDNS is a flexible and scalable DNS server that is installed for Pods in Nebula Graph clusters.

    Components in a Nebula Graph cluster communicate with each other via DNS resolutions for domain names, like x.default.svc.cluster.local.

  • cert-manager

    Note

    If you have set the value of the Nebula Operator configuration item admissionWebhook.create to false, there is no need to install cert-manager. For details about Nebula Operator configuration items, see the Customize Helm charts section in Install Nebula Operator below.

    cert-manager is a tool that automates the management of certificates. It leverages extensions of the Kubernetes API and uses the Webhook server to provide dynamic access control to cert-manager resources. For more information about installation, see cert-manager installation documentation.

    cert-manager is used to validate the numeric value of replicas for each component in a Nebula Graph cluster. If you run it in a production environment and care about the high availability of Nebula Graph clusters, it is recommended to set the value of admissionWebhook.create to true before installing cert-manager.

  • OpenKruise

    OpenKruise is a full set of standard extensions for Kubernetes. It works well with original Kubernetes and provides more powerful and efficient features for managing Pods, sidecar containers, and even container images in clusters. OpenKruise is required to enable advanced features for StatefulSets when Nebula Operator starts. For information about installation, see openkruise installation documentation.

Steps

Install Nebula Operator

  1. Add the Nebula 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 Nebula Operator.

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

    For example, the command to install Nebula Operator of version 0.9.0 is as follows.

    helm install nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=0.9.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.
    • 0.9.0 is the version of the Nebula Operator chart. It can be unspecified when there is only one chart version in the Nebula Operator chart repository. Run helm search repo -l nebula-operator to see chart versions.

    You can customize the configuration items of the Nebula 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:v0.9.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:v0.9.0 The image of Nebula Operator, version of which is 0.9.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 Nebula Operator's AdmissionWebhook mechanism to be turned off when you install Nebula 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 Nebula Operator

After installing Nebula Operator, you can update it by modifying the parameter values in the ${HOME}/nebula-operator/charts/nebula-operator/values.yaml file.

  1. Clone the Nebula Operator repository to your local server.

    git clone https://github.com/vesoft-inc/nebula-operator.git
    
  2. Modify the parameter values in ${HOME}/nebula-operator/charts/nebula-operator/values.yaml.

  3. Run the following command to update Nebula Operator.

    helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> -f ${HOME}/nebula-operator/charts/nebula-operator/values.yaml
    

    <namespace_name> is a user-created namespace name. Pods related to the nebula-operator repository are in this namespace.

Upgrade Nebula Operator

Legacy version compatibility

Starting from Nebula Operator 0.9.0, logs and data are stored separately. Managing a Nebula Graph 2.5.x cluster with Nebula Operator 0.9.0 or later versions can cause compatibility issues. You can backup the data of the Nebula Graph 2.5.x cluster and then create a 2.6.x cluster with Operator.

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

    helm repo update
    
  2. Upgrade Operator.

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

    For example:

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

    Output:

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

    Note

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

    helm pull nebula-operator/nebula-operator
    
  4. Upgrade the CRD configuration file.

    kubectl apply -f <crd_file_name>.yaml
    

    For example:

    kubectl apply -f config/crd/bases/apps.nebula-graph.io_nebulaclusters.yaml
    

    Output:

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

Uninstall Nebula Operator

  1. Uninstall the Nebula 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 Nebula Graph clusters with Nebula Operator. For more information, see Deploy Nebula Graph Clusters with Kubectl or Deploy Nebula Graph Clusters with Helm.


Last update: November 16, 2021
Back to top