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

opt for operator1.4.2 #2063

Merged
merged 5 commits into from
Apr 19, 2023
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
51 changes: 34 additions & 17 deletions docs-2.0/nebula-operator/2.deploy-nebula-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,30 @@ Before installing NebulaGraph Operator, you need to install the following softwa
helm repo add nebula-operator https://vesoft-inc.github.io/nebula-operator/charts
```

1. Update information of available charts locally from repositories.
2. Update information of available charts locally from repositories.

```bash
helm repo update
```

For more information about `helm repo`, see [Helm Repo](https://helm.sh/docs/helm/helm_repo/).

3. Install NebulaGraph Operator.
3. Create a namespace for NebulaGraph Operator.

```bash
kubectl create namespace <namespace_name>
```

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

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

```bash
helm install nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> --version=${chart_version}
Expand All @@ -54,13 +69,18 @@ Before installing NebulaGraph Operator, you need to install the following softwa

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

- `{{operator.release}}` is the version of the NebulaGraph 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.
- `{{operator.release}}` 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

Run `helm show values [CHART] [flags]` to see configurable options.
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](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing).

View the related configuration options in the [nebula-operator chart](https://github.com/vesoft-inc/nebula-operator/blob/v{{operation.release}}/charts/nebula-operator/values.yaml) configuration file.

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


For example:

Expand All @@ -71,10 +91,10 @@ image:
image: vesoft/nebula-operator:{{operator.tag}}
imagePullPolicy: Always
kubeRBACProxy:
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.13.0
imagePullPolicy: Always
kubeScheduler:
image: k8s.gcr.io/kube-scheduler:v1.18.8
image: registry.k8s.io/kube-scheduler:v1.24.11
imagePullPolicy: Always

imagePullSecrets: []
Expand All @@ -93,7 +113,7 @@ controllerManager:
memory: 100Mi

admissionWebhook:
create: true
create: false

scheduler:
create: true
Expand All @@ -119,17 +139,17 @@ Part of the above parameters are described as follows:
| `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. |
| `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](https://cert-manager.io/docs/installation/helm/). |
| `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](https://helm.sh/docs/intro/using_helm/#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):
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):

```bash
helm install nebula-operator nebula-operator/nebula-operator --namespace=<nebula-operator-system> --set admissionWebhook.create=false
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](https://helm.sh/docs/helm/helm_install/).
Expand All @@ -142,17 +162,14 @@ For more information about `helm install`, see [Helm Install](https://helm.sh/do
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.
1. Update NebulaGraph Operator by passing configuration parameters via `--set`.

For configurable items, see the above-mentioned section **Customize Helm charts**.
- `--set`:Overrides values using the command line. 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:
For example, to enable the AdmissionWebhook, run the following command:

```bash
helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version={{operator.release}} --set admissionWebhook.create=false
helm upgrade nebula-operator nebula-operator/nebula-operator --namespace=nebula-operator-system --version={{operator.release}} --set admissionWebhook.create=true
```

For more information, see [Helm upgrade](https://helm.sh/docs/helm/helm_update/).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

## Prerequisites

- [Install NebulaGraph Operator](../2.deploy-nebula-operator.md)
- [You have installed NebulaGraph Operator](../2.deploy-nebula-operator.md)

- [You have created StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/)

{{ ent.ent_begin }}
- You have prepared the license file for NebulaGraph Enterprise Edition clusters.
Expand All @@ -21,163 +23,49 @@ The following example shows how to create a NebulaGraph cluster by creating a cl

1. Create a file named `apps_v1alpha1_nebulacluster.yaml`.

- The file contents for a NebulaGraph Community cluster are as follows:
- For a NebulaGraph Community cluster

```
apiVersion: apps.nebula-graph.io/v1alpha1
kind: NebulaCluster
metadata:
name: nebula
spec:
graphd:
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1"
memory: "1Gi"
replicas: 1
image: vesoft/nebula-graphd
version: {{nebula.tag}}
logVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: fast-disks
metad:
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1"
memory: "1Gi"
replicas: 1
image: vesoft/nebula-metad
version: {{nebula.tag}}
logVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: fast-disks
dataVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: fast-disks
storaged:
resources:
requests:
cpu: "500m"
memory: "500Mi"
limits:
cpu: "1"
memory: "1Gi"
replicas: 1
image: vesoft/nebula-storaged
version: {{nebula.tag}}
logVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: fast-disks
dataVolumeClaims: // You can mount multiple disks starting from NebulaGraph Operator 1.3.0.
- resources:
requests:
storage: 2Gi
storageClassName: fast-disks
- resources:
requests:
storage: 2Gi
storageClassName: fast-disks
enableAutoBalance: true
reference:
name: statefulsets.apps
version: v1
schedulerName: default-scheduler
nodeSelector:
nebula: cloud
imagePullPolicy: Always
unsatisfiableAction: ScheduleAnyway
```
Create a file named `apps_v1alpha1_nebulacluster.yaml`. For the file content, see the [sample configuration](https://github.com/vesoft-inc/nebula-operator/blob/v{{operator.release}}/config/samples/apps_v1alpha1_nebulacluster.yaml).

The parameters in the file are described as follows:

| Parameter | Default value | Description |
| :---- | :--- | :--- |
| `metadata.name` | - | The name of the created NebulaGraph 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` | `{{nebula.tag}}` | The version of the Graphd service. |
| `spec.graphd.service` | - | The Service 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` | `{{nebula.tag}}` | 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` | `{{nebula.tag}}` | The version of the Storaged service. |
| `spec.storaged.dataVolumeClaims.resources.requests.storage` | - | Data disk storage size for the Storaged service. You can specify multiple data disks to store data. When multiple disks are specified, the storage path is `/usr/local/nebula/data1`, `/usr/local/nebula/data2`, etc.|
| `spec.storaged.dataVolumeClaims.resources.storageClassName` | - | The data disk storage configurations for Storaged. If not specified, the global storage parameter is applied. |
| `spec.storaged.logVolumeClaim.storageClassName`|- | The log disk storage configurations for the Storaged service.|
| `spec.storaged.enableAutoBalance` | `true` |Whether to balance data automatically. |
| `spec.reference.name` | - | The name of the dependent controller. |
| `spec.schedulerName` | - | The scheduler name. |
| `spec.imagePullPolicy` | The image policy to pull the NebulaGraph image. For details, see [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy). | The image pull policy in Kubernetes. |
|`spec.logRotate`| - |Log rotation configuration. For more information, see [Manage cluster logs](../8.custom-cluster-configurations/8.4.manage-running-logs.md).|
|`spec.enablePVReclaim`|`false`|Define whether to automatically delete PVCs and release data after deleting the cluster. For more information, see [Reclaim PVs](../8.custom-cluster-configurations/8.2.pv-reclaim.md).|

{{ ent.ent_begin }}

- The file contents for a NebulaGraph Enterprise cluster are as follows:

```yaml
# Contact our sales team to get a complete NebulaGraph Enterprise Edition cluster YAML example.

apiVersion: apps.nebula-graph.io/v1alpha1
kind: NebulaCluster
metadata:
annotations:
nebula-graph.io/owner: test
name: nebula
spec:
graphd:
readinessProbe:
failureThreshold: 3
httpGet:
path: /status
port: 19669
scheme: HTTP
initialDelaySeconds: 40
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10
image: reg.vesoft-inc.com/vesoft-ent/nebula-graphd
logVolumeClaim:
resources:
requests:
storage: 2Gi
storageClassName: fast-disks
replicas: 1
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: 500m
memory: 500Mi
version: {{nebula.tag}}
imagePullPolicy: Always
imagePullSecrets:
- name: vesoft
metad:
license:
secretName: nebula-license
licenseKey: nebula.license
...
```

The parameters in the file are described as follows:

| Parameter | Default value | Description |
| :---- | :--- | :--- |
| `metadata.name` | - | The name of the created NebulaGraph 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` | `{{nebula.tag}}` | The version of the Graphd service. |
| `spec.graphd.service` | - | The Service 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` | `{{nebula.tag}}` | 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` | `{{nebula.tag}}` | The version of the Storaged service. |
| `spec.storaged.dataVolumeClaims.resources.requests.storage` | - | Data disk storage size for the Storaged service. You can specify multiple data disks to store data. When multiple disks are specified, the storage path is `/usr/local/nebula/data1`, `/usr/local/nebula/data2`, etc.|
| `spec.storaged.dataVolumeClaims.resources.storageClassName` | - | The data disk storage configurations for Storaged. If not specified, the global storage parameter is applied. |
| `spec.storaged.logVolumeClaim.storageClassName`|- | The log disk storage configurations for the Storaged service.|
| `spec.storaged.enableAutoBalance` | `true` |Whether to balance data automatically. |
| `spec.reference.name` | - | The name of the dependent controller. |
| `spec.schedulerName` | - | The scheduler name. |
| `spec.imagePullPolicy` | The image policy to pull the NebulaGraph image. For details, see [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy). | The image pull policy in Kubernetes. |
| `spec.metad.license` | - | The configuration of the license for creating a NebulaGraph Enterprise Edition cluster. |
- For a NebulaGraph Enterprise cluster

Create a file named `apps_v1alpha1_nebulacluster.yaml`. Contact our sales team to get a complete NebulaGraph Enterprise Edition cluster YAML example.

| Parameter | Default value | Description |
| :---- | :--- | :--- |
| `spec.metad.license` | - | The configuration of the license for creating a NebulaGraph Enterprise Edition cluster. |
|`spec.storaged.enableAutoBalance`| `false`| Specifies whether to enable automatic data balancing. For more information, see [Balance storage data after scaling out](../8.custom-cluster-configurations/8.3.balance-data-when-scaling-storage.md).|
|`spec.enableBR`|`false`|Specifies whether to enable the BR tool. For more information, see [Backup and restore](../10.backup-restore-using-operator.md).|

!!! enterpriseonly

Expand Down
Loading