Deploy Nebula Operator¶
You can deploy Nebula Operator with Helm.
Background¶
Nebula 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¶
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 is a flexible and scalable DNS server that is installed for Pods in NebulaGraph clusters.
Components in a NebulaGraph cluster communicate with each other via DNS resolutions for domain names, like
x.default.svc.cluster.local
.
-
Note
If you have set the value of the Nebula Operator configuration item
admissionWebhook.create
tofalse
, 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 NebulaGraph cluster. If you run it in a production environment and care about the high availability of NebulaGraph clusters, it is recommended to set the value of
admissionWebhook.create
totrue
before installing cert-manager.
-
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¶
-
Add the Nebula Operator chart repository to Helm.
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
For more information about
helm repo
, see Helm Repo. -
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 1.1.0 is as follows.
helm install nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=1.1.0
nebula-operator-system
is a user-created namespace name. If you have not created this namespace, runkubectl create namespace nebula-operator-system
to create one. You can also use a different name.
1.1.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. Runhelm 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:v1.1.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.1.0 |
The image of Nebula Operator, version of which is 1.1.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¶
-
Update the information of available charts locally from chart repositories.
helm repo update
-
Update Nebula 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.1.0 --set admissionWebhook.create=false
For more information, see Helm upgrade.
Upgrade Nebula Operator¶
Legacy version compatibility
- Does not support upgrading 0.9.0 and below version NebulaGraph Operator to 1.x.
- The 1.x version Nebula Operator is not compatible with NebulaGraph of version below v3.x.
-
Update the information of available charts locally from chart repositories.
helm repo update
-
Upgrade Operator to v1.1.0.
helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> --version=1.1.0
For example:
helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version=1.1.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: Nebula Operator installed!
-
Pull the latest CRD configuration file.
Note
You need to upgrade the corresponding CRD configurations after Nebula Operator is upgraded. Otherwise, the creation of NebulaGraph clusters will fail. For information about the CRD configurations, see apps.nebula-graph.io_nebulaclusters.yaml.
-
Pull the Nebula Operator chart package.
helm pull nebula-operator/nebula-operator --version=1.1.0
--version
: The Nebula Operator version you want to upgrade to. If not specified, the latest version will be pulled.
-
Run
tar -zxvf
to unpack the charts.For example: To unpack v1.1.0 chart to the
/tmp
path, run the following command:tar -zxvf nebula-operator-1.1.0.tgz -C /tmp
-C /tmp
: If not specified, the chart files will be unpacked to the current directory.
-
-
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 Nebula Operator¶
-
Uninstall the Nebula Operator chart.
helm uninstall nebula-operator --namespace=<nebula-operator-system>
-
Delete CRD.
kubectl delete crd nebulaclusters.apps.nebula-graph.io
What's next¶
Automate the deployment of NebulaGraph clusters with Nebula Operator. For more information, see Deploy NebulaGraph Clusters with Kubectl or Deploy NebulaGraph Clusters with Helm.