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

[auto-pick-to-v3.5.0]add LM in operator #2803

Merged
merged 1 commit into from
May 30, 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
Original file line number Diff line number Diff line change
Expand Up @@ -8,87 +8,68 @@

- [安装 NebulaGraph Operator](../2.deploy-nebula-operator.md)
- [已创建 StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/)
{{ent.ent_begin}}
- [已安装 LM 并加载 License Key](../../9.about-license/2.license-management-suite/3.license-manager.md)
{{ent.ent_end}}

## 创建集群

本文以创建名为`nebula`的集群为例,说明如何部署{{nebula.name}}集群。

1. 创建集群配置文件。

- 社区版集群示例。

创建名为`apps_v1alpha1_nebulacluster.yaml`的文件。文件内容参见[示例配置](https://github.com/vesoft-inc/nebula-operator/blob/v{{operator.release}}/config/samples/apps_v1alpha1_nebulacluster.yaml)。

示例配置的参数描述如下:

| 参数 | 默认值 | 描述 |
| :---- | :--- | :--- |
| `metadata.name` | - | 创建的{{nebula.name}}集群名称。 |
| `spec.graphd.replicas` | `1` | Graphd 服务的副本数。 |
| `spec.graphd.images` | `vesoft/nebula-graphd` | Graphd 服务的容器镜像。 |
| `spec.graphd.version` | `{{nebula.tag}}` | Graphd 服务的版本号。 |
| `spec.graphd.service` | | 访问 Graphd 服务的 Service 配置。 |
| `spec.graphd.logVolumeClaim.storageClassName` | - | Graphd 服务的日志盘存储卷的存储类名称。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.metad.replicas` | `1` | Metad 服务的副本数。 |
| `spec.metad.images` | `vesoft/nebula-metad` | Metad 服务的容器镜像。 |
| `spec.metad.version` | `{{nebula.tag}}` | Metad 服务的版本号。 |
| `spec.metad.dataVolumeClaim.storageClassName` | - | Metad 服务的数据盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.metad.logVolumeClaim.storageClassName`|-|Metad 服务的日志盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.storaged.replicas` | `3` | Storaged 服务的副本数。 |
| `spec.storaged.images` | `vesoft/nebula-storaged` | Storaged 服务的容器镜像。 |
| `spec.storaged.version` | `{{nebula.tag}}` | Storaged 服务的版本号。 |
| `spec.storaged.dataVolumeClaims.resources.requests.storage` | - | Storaged 服务的数据盘存储大小,可指定多块数据盘存储数据。当指定多块数据盘时,路径为:`/usr/local/nebula/data1`、`/usr/local/nebula/data2`等。 |
| `spec.storaged.dataVolumeClaims.resources.storageClassName` | - | Storaged 服务的数据盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.storaged.logVolumeClaim.storageClassName`|-|Storaged 服务的日志盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.reference.name` | - | 依赖的控制器名称。 |
| `spec.schedulerName` | - | 调度器名称。 |
| `spec.imagePullPolicy` | {{nebula.name}}镜像的拉取策略。关于拉取策略详情,请参考 [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy)。 | 镜像拉取策略。 |
|`spec.logRotate`| - |日志轮转配置。详情参见[管理集群日志](../8.custom-cluster-configurations/8.4.manage-running-logs.md)。|
|`spec.enablePVReclaim`|`false`|定义是否在删除集群后自动删除 PVC 以释放数据。详情参见[回收 PV](../8.custom-cluster-configurations/8.2.pv-reclaim.md)。|

{{comm.comm_begin}}
创建名为`apps_v1alpha1_nebulacluster.yaml`的文件。文件内容参见[示例配置](https://github.com/vesoft-inc/nebula-operator/blob/v{{operator.release}}/config/samples/apps_v1alpha1_nebulacluster.yaml)。
{{comm.comm_begin}}

{{ent.ent_begin}}
联系销售人员获取完整配置示例。
{{ent.ent_end}}

示例配置的参数描述如下:

| 参数 | 默认值 | 描述 |
| :---- | :--- | :--- |
| `metadata.name` | - | 创建的{{nebula.name}}集群名称。 |
| `spec.graphd.replicas` | `1` | Graphd 服务的副本数。 |
| `spec.graphd.images` | `vesoft/nebula-graphd` | Graphd 服务的容器镜像。 |
| `spec.graphd.version` | `{{nebula.tag}}` | Graphd 服务的版本号。 |
| `spec.graphd.service` | | 访问 Graphd 服务的 Service 配置。 |
| `spec.graphd.logVolumeClaim.storageClassName` | - | Graphd 服务的日志盘存储卷的存储类名称。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.metad.replicas` | `1` | Metad 服务的副本数。 |
| `spec.metad.images` | `vesoft/nebula-metad` | Metad 服务的容器镜像。 |
| `spec.metad.version` | `{{nebula.tag}}` | Metad 服务的版本号。 |
| `spec.metad.dataVolumeClaim.storageClassName` | - | Metad 服务的数据盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.metad.logVolumeClaim.storageClassName`|-|Metad 服务的日志盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.storaged.replicas` | `3` | Storaged 服务的副本数。 |
| `spec.storaged.images` | `vesoft/nebula-storaged` | Storaged 服务的容器镜像。 |
| `spec.storaged.version` | `{{nebula.tag}}` | Storaged 服务的版本号。 |
| `spec.storaged.dataVolumeClaims.resources.requests.storage` | - | Storaged 服务的数据盘存储大小,可指定多块数据盘存储数据。当指定多块数据盘时,路径为:`/usr/local/nebula/data1`、`/usr/local/nebula/data2`等。 |
| `spec.storaged.dataVolumeClaims.resources.storageClassName` | - | Storaged 服务的数据盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.storaged.logVolumeClaim.storageClassName`|-|Storaged 服务的日志盘存储配置。使用示例配置时需要将其替换为事先创建的存储类名称,参见 [Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/) 查看创建存储类详情。 |
| `spec.reference.name` | - | 依赖的控制器名称。 |
| `spec.schedulerName` | - | 调度器名称。 |
| `spec.imagePullPolicy` | {{nebula.name}}镜像的拉取策略。关于拉取策略详情,请参考 [Image pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy)。 | 镜像拉取策略。 |
|`spec.logRotate`| - |日志轮转配置。详情参见[管理集群日志](../8.custom-cluster-configurations/8.4.manage-running-logs.md)。|
|`spec.enablePVReclaim`|`false`|定义是否在删除集群后自动删除 PVC 以释放数据。详情参见[回收 PV](../8.custom-cluster-configurations/8.2.pv-reclaim.md)。|

{{ ent.ent_begin }}

- 企业版集群示例。

创建名为`apps_v1alpha1_nebulacluster.yaml`的文件。联系销售人员获取完整配置示例。


企业版特有参数描述如下:
{{nebula.name}}特有参数描述如下:

| 参数 | 默认值 | 描述 |
| :---- | :--- | :--- |
| `spec.metad.license` | - | 创建{{nebula.name}}集群所需的 License 配置。 |
|`spec.storaged.enableAutoBalance`| `false`| 是否启用自动均衡。详情参见[均衡扩容后的 Storage 数据](../8.custom-cluster-configurations/8.3.balance-data-when-scaling-storage.md)。|
|`spec.enableBR`|`false`|定义是否启用 BR 工具。详情参见[备份与恢复](../10.backup-restore-using-operator.md)。|
| 参数 | 默认值 | 描述 |
| :---- | :--- | :--- |
| `spec.metad.licenseManagerURL` | - | 配置指向 [LM](../../9.about-license/2.license-management-suite/3.license-manager.md) 的 URL,由 LM 的访问地址和端口(默认端口`9119`)组成。例如,`192.168.8.100:9119`。**必须配置此参数以获取 License 信息,否则无法使用{{nebula.name}}集群。** |
|`spec.storaged.enableAutoBalance`| `false`| 是否启用自动均衡。详情参见[均衡扩容后的 Storage 数据](../8.custom-cluster-configurations/8.3.balance-data-when-scaling-storage.md)。|
|`spec.enableBR`|`false`|定义是否启用 BR 工具。详情参见[备份与恢复](../10.backup-restore-using-operator.md)。|

!!! enterpriseonly

拉取企业版{{nebula.name}}集群镜像前,请确保已联系销售人员([[email protected]](mailto:[email protected]))获取企业版{{nebula.name}}集群的镜像信息。


2. 配置集群 License。

!!! enterpriseonly

- 此步骤只适用于创建企业版{{nebula.name}}h集群。

- 创建社区版{{nebula.name}}集群时,忽略此步骤。

```bash
kubectl create secret generic nebula-license --from-file=nebula.license
```

查看集群 License 信息:

```bash
kubectl get secrets nebula-license -o yaml
```
拉取{{nebula.name}}集群镜像前,请确保已联系销售人员([[email protected]](mailto:[email protected]))获取{{nebula.name}}集群的镜像信息。

{{ ent.ent_end }}


3. 创建{{nebula.name}}集群。
2. 创建{{nebula.name}}集群。

```bash
kubectl create -f apps_v1alpha1_nebulacluster.yaml
Expand All @@ -101,7 +82,7 @@
```


4. 查看{{nebula.name}}集群状态。
3. 查看{{nebula.name}}集群状态。

```bash
kubectl get nebulaclusters nebula
Expand All @@ -116,11 +97,13 @@

## 扩缩容集群

- 不支持扩缩容社区版的{{nebula.name}}集群。
{{comm.comm_begin}}
不支持扩缩容社区版的{{nebula.name}}集群。
{{comm.comm_end}}

{{ ent.ent_begin }}

- 仅支持通过 v1.1.0 及以上版本的 NebulaGraph Operator 扩缩容企业版的{{nebula.name}}集群。
仅支持通过 v1.1.0 及以上版本的 NebulaGraph Operator 扩缩容{{nebula.name}}集群。

用户可以通过编辑`apps_v1alpha1_nebulacluster.yaml`文件中的`replicas`的值进行{{nebula.name}}集群的扩缩容。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@

- [安装 NebulaGraph Operator](../2.deploy-nebula-operator.md)
- [已创建 StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/)

{{ ent.ent_begin }}
- 准备相应的 License 文件

!!! enterpriseonly

只有当创建的{{nebula.name}}集群是企业版本时,才需要提供 License 文件。
{{ ent.ent_end }}
{{ent.ent_begin}}
- [已安装 LM 并加载 License Key](../../9.about-license/2.license-management-suite/3.license-manager.md)
{{ent.ent_end}}

## 创建{{nebula.name}}集群

Expand Down Expand Up @@ -45,61 +40,39 @@
kubectl create namespace "${NEBULA_CLUSTER_NAMESPACE}"
```

{{ ent.ent_begin }}

5. 配置集群 License。

!!! enterpriseonly

- 此步骤只适用于创建企业版 NebulaGraph集群。

- 创建社区版{{nebula.name}}集群时,忽略此步骤。

```bash
kubectl create secret generic nebula-license --from-file=nebula.license
```

查看集群 License 信息:

```bash
kubectl get secrets nebula-license -o yaml
```
{{ ent.ent_end }}

6. 创建{{nebula.name}}集群。
5. 创建{{nebula.name}}集群。

```bash
helm install "${NEBULA_CLUSTER_NAME}" nebula-operator/nebula-cluster \
--namespace="${NEBULA_CLUSTER_NAMESPACE}" \
{{ ent.ent_begin }}
# 配置指向 LM 访问地址和端口,默认端口为`9119`。必须配置此参数以获取 License 信息。
--set nebula.metad.licenseManagerURL=`192.168.8.XXX:9119` \
{{ ent.ent_end }}
--set nameOverride=${NEBULA_CLUSTER_NAME} \
--set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
# 指定 NebulaGraph 集群的版本。
# 指定{{nebula.name}}集群的版本。
--set nebula.version=v{{nebula.release}} \
# 指定 nebula-cluster chart 的版本,不指定则默认安装最新版本 chart。
# 指定集群 chart 的版本,不指定则默认安装最新版本 chart。
--version={{operator.release}}
--namespace="${NEBULA_CLUSTER_NAMESPACE}" \
```

{{ ent.ent_begin }}

!!! enterpriseonly

如果创建的是企业版{{nebula.name}}集群,需要在上述命令中添加`--set nebula.metad.license.secretName=nebula-license`和`--set nebula.metad.license.licenseKey=nebula.license`参数。

{{ ent.ent_end }}

7. 查看{{nebula.name}}集群创建状态。
6. 查看{{nebula.name}}集群创建状态。

```bash
kubectl -n "${NEBULA_CLUSTER_NAMESPACE}" get pod -l "app.kubernetes.io/cluster=${NEBULA_CLUSTER_NAME}"
```

## 扩缩容集群

- 不支持扩缩容社区版的{{nebula.name}}集群。
{{comm.comm_begin}}
不支持扩缩容社区版的{{nebula.name}}集群。
{{comm.comm_end}}

{{ ent.ent_begin }}

- 仅支持通过 v1.1.0 及以上版本的 NebulaGraph Operator 扩缩容企业版的{{nebula.name}}集群。
仅支持通过 v1.1.0 及以上版本的 NebulaGraph Operator 扩缩容{{nebula.name}}集群。


用户可通过定义{{nebula.name}}中不同服务对应的`replicas`的值扩缩容 Nebuala Graph 集群。
Expand Down Expand Up @@ -171,7 +144,7 @@ helm uninstall nebula --namespace=nebula
| `nebula.metad.resources` | `{"resources":{"requests":{"cpu":"500m","memory":"500Mi"},"limits":{"cpu":"1","memory":"1Gi"}}}` | Metad 服务的资源配置。 |
| `nebula.metad.logStorage` | `500Mi` | Metad 服务的日志盘大小。 |
| `nebula.metad.dataStorage` | `1Gi` | Metad 服务的数据盘大小。 |
| `nebula.metad.license` | `{}` | 创建企业版{{nebula.name}}集群所需的 License 配置。 |
| `nebula.metad.licenseManagerURL` | `{}` | 由 License Manager 的访问地址和端口(默认端口`9119`)组成。例如,`192.168.8.100:9119`。社区版集群可忽略此参数。{{ent.ent_begin}}使用{{nebula.name}}时,必须配置该参数以获取 License 信息。 {{ent.ent_end}} |
| `nebula.metad.podLabels` | `{}` | Metad 服务 Pod 的标签。 |
| `nebula.metad.podAnnotations` | `{}` | Metad 服务 Pod 的注解。 |
| `nebula.metad.nodeSelector` | `{}` | 为 Metad pod 设置节点标签以分配至指定的节点中。 |
Expand Down