Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator new&updates for 260 #921

Merged
merged 5 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs-2.0/20.appendix/6.eco-tool-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ Nebula Operator (Operator for short) is a tool to automate the deployment, opera

|Nebula Graph version|Operator version(commit id)|
|:---|:---|
| {{ nebula.release }} | {{operator.release}}(6d1104e) |
-->
| {{ nebula.release }} | {{operator.release}}(ba88e28) |

## Nebula Importer

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The following features are already available in Nebula Operator:

- **Scale clusters**: Nebula Operator calls Nebula Graph's native scaling interfaces in a control loop to implement the scaling logic. You can simply perform scaling operations with YAML configurations and ensure the stability of data. For more information, see [Scale clusters with Kubectl](3.deploy-nebula-graph-cluster/3.1create-cluster-with-kubectl.md#_3) or [Scale clusters with Helm](3.deploy-nebula-graph-cluster/3.2create-cluster-with-helm.md#_2).

- **Cluster Upgrade**: Nebula Operator supports cluster upgrading from version 2.5.x to version 2.6.x.

- **Self-Healing**: Nebula Operator calls interfaces provided by Nebula Graph clusters to dynamically sense cluster service status. Once an exception is detected, Nebula Operator performs fault tolerance. For more information, see [Self-Healing](5.operator-failover.md).

- **Balance Scheduling**: Based on the scheduler extension interface, the scheduler provided by Nebula Operator evenly distributes Pods in a Nebula Graph cluster across all nodes.
Expand All @@ -30,7 +32,8 @@ Nebula Operator does not support the v1.x version of Nebula Graph. Nebula Operat

| Nebula Operator version | Nebula Graph version |
| ------------------- | ---------------- |
| {{operator.release}}| {{nebula.release}} |
| {{operator.release}}| 2.5.x ~ 2.6.x |
|0.8.0|2.5.x|

### Feature limitations

Expand Down
109 changes: 90 additions & 19 deletions docs-2.0/nebula-operator/2.deploy-nebula-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ If using a role-based access control policy, you need to enable [RBAC](https://k
3. Install Nebula Operator.

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

- `<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.
For example, the command to install Nebula Operator of version {{operator.release}} is as follows.

```bash
helm install nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version={{operator.release}}
```

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

- `${chart_version}` 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.
- `{{operator.release}}` 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.

Expand All @@ -88,14 +94,14 @@ For example:
[k8s@master ~]$ helm show values nebula-operator/nebula-operator
image:
nebulaOperator:
image: vesoft/nebula-operator:v0.8.0
imagePullPolicy: IfNotPresent
image: vesoft/nebula-operator:{{operator.branch}}
imagePullPolicy: Always
kubeRBACProxy:
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
kubeScheduler:
image: k8s.gcr.io/kube-scheduler:v1.18.8
imagePullPolicy: IfNotPresent
imagePullPolicy: Always

imagePullSecrets: []
kubernetesClusterDomain: ""
Expand All @@ -106,11 +112,11 @@ controllerManager:
env: []
resources:
limits:
cpu: 100m
memory: 30Mi
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 20Mi
memory: 100Mi

admissionWebhook:
create: true
Expand All @@ -122,21 +128,21 @@ scheduler:
env: []
resources:
limits:
cpu: 100m
memory: 30Mi
cpu: 200m
memory: 20Mi
requests:
cpu: 100m
memory: 20Mi
memory: 100Mi
```

The parameters in `values.yaml` are described as follows:
Part of the above parameters are described as follows:

| Parameter | Default value | Description |
| :------------------------------------- | :------------------------------ | :----------------------------------------- |
| `image.nebulaOperator.image` | `vesoft/nebula-operator:v0.8.0` | The image of Nebula Operator, version of which is v0.8.0. |
| `image.nebulaOperator.image` | `vesoft/nebula-operator:{{operator.branch}}` | The image of Nebula Operator, version of which is {{operator.release}}. |
| `image.nebulaOperator.imagePullPolicy` | `IfNotPresent` | The image pull policy in Kubernetes. |
| `imagePullSecrets` | - | The image pull secret in Kubernetes. |
| `kubernetesClusterDomain` | `cluster.local` | The cluster domain. |
| `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. |
Expand All @@ -154,7 +160,7 @@ helm install nebula-operator nebula-operator/nebula-operator --namespace=<nebula

For more information about `helm install`, see [Helm Install](https://helm.sh/docs/helm/helm_install/).

### Upgrade Nebula Operator
### 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.

Expand All @@ -169,10 +175,75 @@ After installing Nebula Operator, you can update it by modifying the parameter v
3. Run the following command to update Nebula Operator.

```bash
helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=<nebula-operator-system> -f ${HOME}/nebula-operator/charts/nebula-operator/values.yaml
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

!!! Compatibility "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.

```bash
helm repo update
```

2. Upgrade Operator.

```bash
helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> --version={{operator.release}}
```

For example:

```bash
helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version={{operator.release}}
```

Output:

```bash
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](https://github.com/vesoft-inc/nebula-operator/blob/{{operator.branch}}/config/crd/bases/apps.nebula-graph.io_nebulaclusters.yaml).

```bash
helm pull nebula-operator/nebula-operator
```

4. Upgrade the CRD configuration file.

```bash
kubectl apply -f <crd_file_name>.yaml
```

For example:

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

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

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

### Uninstall Nebula Operator

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ The following example shows how to create a Nebula Graph cluster by creating a c
memory: "1Gi"
replicas: 1
image: vesoft/nebula-graphd
version: v2.5.1
version: {{nebula.branch}}
service:
type: NodePort
externalTrafficPolicy: Local
storageClaim:
logVolumeClaim:
resources:
requests:
storage: 2Gi
Expand All @@ -47,8 +47,13 @@ The following example shows how to create a Nebula Graph cluster by creating a c
memory: "1Gi"
replicas: 1
image: vesoft/nebula-metad
version: v2.5.1
storageClaim:
version: {{nebula.branch}}
dataVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: gp2
logVolumeClaim:
resources:
requests:
storage: 2Gi
Expand All @@ -63,8 +68,13 @@ The following example shows how to create a Nebula Graph cluster by creating a c
memory: "1Gi"
replicas: 3
image: vesoft/nebula-storaged
version: v2.5.1
storageClaim:
version: {{nebula.branch}}
dataVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: gp2
logVolumeClaim:
resources:
requests:
storage: 2Gi
Expand All @@ -73,7 +83,7 @@ The following example shows how to create a Nebula Graph cluster by creating a c
name: statefulsets.apps
version: v1
schedulerName: default-scheduler
imagePullPolicy: IfNotPresent
imagePullPolicy: Always
```

The parameters in the file are described as follows:
Expand All @@ -83,17 +93,19 @@ The following example shows how to create a Nebula Graph cluster by creating a c
| `metadata.name` | - | The name of the created Nebula Graph 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` | `v2.5.1` | The version of the Graphd service. |
| `spec.graphd.version` | `{{nebula.branch}}` | The version of the Graphd service. |
| `spec.graphd.service` | - | The Service configurations for the Graphd service. |
| `spec.graphd.storageClaim` | - | The storage 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` | `v2.5.1` | The version of the Metad service. |
| `spec.metad.storageClaim` | - | The storage configurations for the Metad service. |
| `spec.metad.version` | `{{nebula.branch}}` | 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` | `v2.5.1` | The version of the Storaged service. |
| `spec.storaged.storageClaim` | - | The storage configurations for the Storaged service. |
| `spec.storaged.version` | `{{nebula.branch}}` | The version of the Storaged service. |
| `spec.storaged.dataVolumeClaim.storageClassName` | - | The data disk storage configurations for the Storaged service. |
| `spec.storaged.logVolumeClaim.storageClassName`|- | The log disk storage configurations for the Storaged service.|
| `spec.reference.name` | - | The name of the dependent controller. |
| `spec.schedulerName` | - | The scheduler name. |
| `spec.imagePullPolicy` | The image policy to pull the Nebula Graph image. For details, see [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy). | The image pull policy in Kubernetes. |
Expand All @@ -119,8 +131,8 @@ The following example shows how to create a Nebula Graph cluster by creating a c
Output:

```bash
NAME GRAPHD-DESIRED GRAPHD-READY METAD-DESIRED METAD-READY STORAGED-DESIRED STORAGED-READY AGE
nebula-cluster 1 1 1 1 3 3 31h
NAME GRAPHD-DESIRED GRAPHD-READY METAD-DESIRED METAD-READY STORAGED-DESIRED STORAGED-READY AGE
nebula 1 1 1 1 3 3 86s
```

## Scaling clusters
Expand All @@ -131,25 +143,34 @@ You can modify the value of `replicas` in `apps_v1alpha1_nebulacluster.yaml` to

The following shows how to scale out a Nebula Graph cluster by changing the number of Storage services to 5:

1. Change the value of the `storaged.replicas` in `apps_v1alpha1_nebulacluster.yaml` from `3` to `5`.
1. Change the value of the `storaged.replicas` from `3` to `5` in `apps_v1alpha1_nebulacluster.yaml`.

```yaml
storaged:
resources:
requests:
cpu: "1"
memory: "1Gi"
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1"
memory: "1Gi"
replicas: 5
image: vesoft/nebula-storaged
version: v2.5.1
storageClaim:
version: {{nebula.branch}}
dataVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: gp2
logVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: fast-disks
storageClassName: gp2
reference:
name: statefulsets.apps
version: v1
schedulerName: default-scheduler
```

2. Run the following command to update the Nebula Graph cluster CR.
Expand Down
Loading