From 1ebadec8fbb903dd75638e18b031d64f6bcdd005 Mon Sep 17 00:00:00 2001 From: "abby.huang" <78209557+abby-cyber@users.noreply.github.com> Date: Thu, 11 Nov 2021 14:33:29 +0800 Subject: [PATCH] Create 9.upgrade-nebula-cluster.md (#1190) * Create 9.upgrade-nebula-cluster.md * Update 9.upgrade-nebula-cluster.md * Update 9.upgrade-nebula-cluster.md * Update 9.upgrade-nebula-cluster.md --- .../9.upgrade-nebula-cluster.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md diff --git a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md new file mode 100644 index 00000000000..22ad1eb2f3b --- /dev/null +++ b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md @@ -0,0 +1,119 @@ +# 升级Nebula Graph集群 + +本文介绍如何升级通过Nebula Operator创建的Nebula Graph集群。 + +## 前提条件 + +已创建Nebula Graph集群。具体步骤,参见[使用Kubectl创建Nebula Graph集群](3.deploy-nebula-graph-cluster/3.1create-cluster-with-kubectl.md)。 + +本文示例中待升级的Nebula Graph版本为2.5.1,其YAML文件名为`apps_v1alpha1_nebulacluster.yaml`。 + +## 使用限制 + +- 只支持使用Nebula Operator创建的Nebula Graph集群。 + +- 只支持升级Nebula Graph 2.5.x至2.6.x版本。 + +## 操作步骤 + +1. 查看集群中服务的镜像版本。 + + ```bash + kubectl get pods -l app.kubernetes.io/cluster=nebula -o jsonpath="{.items[*].spec.containers[*].image}" |tr -s '[[:space:]]' '\n' |sort |uniq -c + ``` + + 返回: + + ```bash + 1 vesoft/nebula-graphd:v2.5.1 + 1 vesoft/nebula-metad:v2.5.1 + 3 vesoft/nebula-storaged:v2.5.1 + ``` + +2. 编辑`apps_v1alpha1_nebulacluster.yaml`并将所有`version`的值从v2.5.1修改至{{nebula.branch}}。 + + 修改后的YAML文件内容如下: + + ```yaml + 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: 2 + image: vesoft/nebula-graphd + version: {{nebula.branch}} //将值从v2.5.1修改至{{nebula.branch}}。 + service: + type: NodePort + externalTrafficPolicy: Local + storageClaim: + resources: + requests: + storage: 2Gi + storageClassName: local-path + metad: + resources: + requests: + cpu: "500m" + memory: "500Mi" + limits: + cpu: "1" + memory: "1Gi" + replicas: 1 + image: vesoft/nebula-metad + version: {{nebula.branch}} //将值从v2.5.1修改至{{nebula.branch}}。 + storageClaim: + resources: + requests: + storage: 2Gi + storageClassName: local-path + storaged: + resources: + requests: + cpu: "500m" + memory: "500Mi" + limits: + cpu: "1" + memory: "1Gi" + replicas: 3 + image: vesoft/nebula-storaged + version: {{nebula.branch}} //将值从v2.5.1修改至{{nebula.branch}}。 + storageClaim: + resources: + requests: + storage: 2Gi + storageClassName: local-path + reference: + name: statefulsets.apps + version: v1 + schedulerName: default-scheduler + imagePullPolicy: IfNotPresent + ``` + +3. 执行以下命令将版本升级的更新应用于集群CR中。 + + ```bash + kubectl apply -f apps_v1alpha1_nebulacluster.yaml + ``` + +4. 等待约2分钟后,执行以下命令可查看到服务的镜像版本变更为{{nebula.branch}}。 + + ```bash + kubectl get pods -l app.kubernetes.io/cluster=nebula -o jsonpath="{.items[*].spec.containers[*].image}" |tr -s '[[:space:]]' '\n' |sort |uniq -c + ``` + + 返回: + + ```bash + 1 vesoft/nebula-graphd:{{nebula.branch}} + 1 vesoft/nebula-metad:{{nebula.branch}} + 3 vesoft/nebula-storaged:{{nebula.branch}} + ``` \ No newline at end of file