From 7c3813ecb2cc2809ae168cc36c32e8020ec4d5fe Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Thu, 11 Nov 2021 11:10:22 +0800 Subject: [PATCH 1/5] Create 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..12a4e3e1898 --- /dev/null +++ b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md @@ -0,0 +1,119 @@ +# Upgrade Nebula Graph clusters created with Nebula Operator + +This topic introduces how to upgrade a Nebula Graph cluster created with Nebula Operator. + +## Prerequisites + +You have created a Nebula Graph cluster. For details, see [Create a Nebula Graph cluster with Kubectl](3.deploy-nebula-graph-cluster/3.1create-cluster-with-kubectl.md)。 + +The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, and its YAML file name is `apps_v1alpha1_nebulacluster.yaml`. + +## Limits + +- Only Nebula Graph clusters created with Nebula Operator are supported. + +- Only Nebula Graph versions 2.5.x to 2.6.x are supported for upgrade. + +## Steps + +1. Check the image version of the services in the cluster. + + ```bash + kubectl get pods -l app.kubernetes.io/cluster=nebula -o jsonpath="{.items[*].spec.containers[*].image}" |tr -s '[[:space:]]' '\n' |sort |uniq -c + ``` + + Output: + + ```bash + 1 vesoft/nebula-graphd:v2.5.1 + 1 vesoft/nebula-metad:v2.5.1 + 3 vesoft/nebula-storaged:v2.5.1 + ``` + +2. Edit the `apps_v1alpha1_nebulacluster.yaml` file by changing the values of all the `version` parameters from v2.5.1 to {{nebula.branch}}. + + The modified YAML file reads as follows: + + ```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}} //Change the value from v2.5.1 to {{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}} //Change the value from v2.5.1 to {{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}} //Change the value from v2.5.1 to {{nebula.branch}}. + storageClaim: + resources: + requests: + storage: 2Gi + storageClassName: local-path + reference: + name: statefulsets.apps + version: v1 + schedulerName: default-scheduler + imagePullPolicy: IfNotPresent + ``` + +3. Run the following command to apply the version update to the cluster CR. + + ```bash + kubectl apply -f apps_v1alpha1_nebulacluster.yaml + ``` + +4. After waiting for about 2 minutes, run the following command to see the image versions of the services in the cluster have been changed to {{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 + ``` + + Output: + + ```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 From 0c51c9adbc5c70b34d5a8e527142ccf27628f7f9 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Thu, 11 Nov 2021 19:06:57 +0800 Subject: [PATCH 2/5] Update 9.upgrade-nebula-cluster.md --- .../9.upgrade-nebula-cluster.md | 124 ++++++++++-------- 1 file changed, 67 insertions(+), 57 deletions(-) diff --git a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md index 12a4e3e1898..af00932703d 100644 --- a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md +++ b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md @@ -38,64 +38,74 @@ The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, apiVersion: apps.nebula-graph.io/v1alpha1 kind: NebulaCluster metadata: - name: nebula + name: nebula spec: - graphd: - resources: - requests: - cpu: "500m" - memory: "500Mi" - limits: - cpu: "1" - memory: "1Gi" - replicas: 2 - image: vesoft/nebula-graphd - version: {{nebula.branch}} //Change the value from v2.5.1 to {{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}} //Change the value from v2.5.1 to {{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}} //Change the value from v2.5.1 to {{nebula.branch}}. - storageClaim: - resources: - requests: - storage: 2Gi - storageClassName: local-path - reference: - name: statefulsets.apps - version: v1 - schedulerName: default-scheduler - imagePullPolicy: IfNotPresent + graphd: + resources: + requests: + cpu: "500m" + memory: "500Mi" + limits: + cpu: "1" + memory: "1Gi" + replicas: 1 + image: vesoft/nebula-graphd + version: {{nebula.branch}} //Change the value from v2.5.1 to {{nebula.branch}}. + service: + type: NodePort + externalTrafficPolicy: Local + logVolumeClaim: + resources: + requests: + storage: 2Gi + storageClassName: gp2 + metad: + resources: + requests: + cpu: "500m" + memory: "500Mi" + limits: + cpu: "1" + memory: "1Gi" + replicas: 1 + image: vesoft/nebula-metad + version: {{nebula.branch}} //Change the value from v2.5.1 to {{nebula.branch}}. + dataVolumeClaim: + resources: + requests: + storage: 2Gi + storageClassName: gp2 + logVolumeClaim: + resources: + requests: + storage: 2Gi + storageClassName: gp2 + storaged: + resources: + requests: + cpu: "500m" + memory: "500Mi" + limits: + cpu: "1" + memory: "1Gi" + replicas: 3 + image: vesoft/nebula-storaged + version: {{nebula.branch}} //Change the value from v2.5.1 to {{nebula.branch}}. + dataVolumeClaim: + resources: + requests: + storage: 2Gi + storageClassName: gp2 + logVolumeClaim: + resources: + requests: + storage: 2Gi + storageClassName: gp2 + reference: + name: statefulsets.apps + version: v1 + schedulerName: default-scheduler + imagePullPolicy: Always ``` 3. Run the following command to apply the version update to the cluster CR. From 2356afb4e9a62e378c22423cc6abf5b276629be9 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Fri, 12 Nov 2021 22:05:16 +0800 Subject: [PATCH 3/5] Update 9.upgrade-nebula-cluster.md --- docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md index af00932703d..cfe65cdac90 100644 --- a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md +++ b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md @@ -14,6 +14,8 @@ The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, - Only Nebula Graph versions 2.5.x to 2.6.x are supported for upgrade. +- Upgrading clusters created via Nebula Operator of version 0.8.0 is not supported. + ## Steps 1. Check the image version of the services in the cluster. From 7cb5bf72376e6e88e24e70f45faf186a0dbe54c9 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Mon, 15 Nov 2021 11:24:40 +0800 Subject: [PATCH 4/5] Update 9.upgrade-nebula-cluster.md --- .../9.upgrade-nebula-cluster.md | 77 +++++++++++++++++-- 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md index cfe65cdac90..099193c5b2d 100644 --- a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md +++ b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md @@ -2,11 +2,6 @@ This topic introduces how to upgrade a Nebula Graph cluster created with Nebula Operator. -## Prerequisites - -You have created a Nebula Graph cluster. For details, see [Create a Nebula Graph cluster with Kubectl](3.deploy-nebula-graph-cluster/3.1create-cluster-with-kubectl.md)。 - -The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, and its YAML file name is `apps_v1alpha1_nebulacluster.yaml`. ## Limits @@ -16,7 +11,17 @@ The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, - Upgrading clusters created via Nebula Operator of version 0.8.0 is not supported. -## Steps + +## Upgrade a Nebula Graph cluster with Kubectl + +### Prerequisites + +You have created a Nebula Graph cluster with Kubectl. For details, see [Create a Nebula Graph cluster with Kubectl](3.deploy-nebula-graph-cluster/3.1create-cluster-with-kubectl.md). + +The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, and its YAML file name is `apps_v1alpha1_nebulacluster.yaml`. + + +### Steps 1. Check the image version of the services in the cluster. @@ -128,4 +133,64 @@ The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, 1 vesoft/nebula-graphd:{{nebula.branch}} 1 vesoft/nebula-metad:{{nebula.branch}} 3 vesoft/nebula-storaged:{{nebula.branch}} + ``` + +## Upgrade a Nebula Graph cluster with Helm + +### Prerequisites + +You have created a Nebula Graph cluster with Helm. For details, see [Create a Nebula Graph cluster with Helm](3.deploy-nebula-graph-cluster/3.2create-cluster-with-helm.md). + +### Steps + +1. Update information of available charts locally from chart repositories. + + ```bash + helm repo update + ``` + +2. Set environment variables to your desired values. + + ```bash + export NEBULA_CLUSTER_NAME=nebula # The desired Nebula Graph cluster name. + export NEBULA_CLUSTER_NAMESPACE=nebula # The desired namespace where your Nebula Graph cluster locates. + ``` + +3. Upgrade a Nebula Graph cluster. + + For example, upgrade a cluster to {{nebula.branch}}. + + ```bash + helm upgrade "${NEBULA_CLUSTER_NAME}" nebula-operator/nebula-cluster \ + --namespace="${NEBULA_CLUSTER_NAMESPACE}" \ + --set nameOverride=${NEBULA_CLUSTER_NAME} \ + --set nebula.version={{nebula.branch}} + ``` + + The value of `--set nebula.version` specifies the version of the cluster you want to upgrade to. + +4. After waiting for a while, run the following command to check the status and version of the upgraded cluster. + + Check cluster status: + + ```bash + $ kubectl -n "${NEBULA_CLUSTER_NAMESPACE}" get pod -l "app.kubernetes.io/cluster=${NEBULA_CLUSTER_NAME}" + NAME READY STATUS RESTARTS AGE + nebula-graphd-0 1/1 Running 0 2m + nebula-graphd-1 1/1 Running 0 2m + nebula-metad-0 1/1 Running 0 2m + nebula-metad-1 1/1 Running 0 2m + nebula-metad-2 1/1 Running 0 2m + nebula-storaged-0 1/1 Running 0 2m + nebula-storaged-1 1/1 Running 0 2m + nebula-storaged-2 1/1 Running 0 2m + ``` + + Check cluster version: + + ```bash + $ kubectl get pods -l app.kubernetes.io/cluster=nebula -o jsonpath="{.items[*].spec.containers[*].image}" |tr -s '[[:space:]]' '\n' |sort |uniq -c + 1 vesoft/nebula-graphd:{{nebula.branch}} + 1 vesoft/nebula-metad:{{nebula.branch}} + 3 vesoft/nebula-storaged:{{nebula.branch}} ``` \ No newline at end of file From 853a9a2e16a5aad46eae9e02e013ab848f46a4c3 Mon Sep 17 00:00:00 2001 From: Abby <78209557+abby-cyber@users.noreply.github.com> Date: Mon, 15 Nov 2021 17:50:17 +0800 Subject: [PATCH 5/5] Update 9.upgrade-nebula-cluster.md --- docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md index 099193c5b2d..7a8130a75a6 100644 --- a/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md +++ b/docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md @@ -7,7 +7,7 @@ This topic introduces how to upgrade a Nebula Graph cluster created with Nebula - Only Nebula Graph clusters created with Nebula Operator are supported. -- Only Nebula Graph versions 2.5.x to 2.6.x are supported for upgrade. +- Only upgrading Nebula Graph from 2.5.x to 2.6.x is supported. - Upgrading clusters created via Nebula Operator of version 0.8.0 is not supported. @@ -121,7 +121,7 @@ The version of the Nebula Graph cluster to be upgraded in this topic is `2.5.1`, kubectl apply -f apps_v1alpha1_nebulacluster.yaml ``` -4. After waiting for about 2 minutes, run the following command to see the image versions of the services in the cluster have been changed to {{nebula.branch}}. +4. After waiting for about 2 minutes, run the following command to see if the image versions of the services in the cluster have been changed to {{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 @@ -143,7 +143,7 @@ You have created a Nebula Graph cluster with Helm. For details, see [Create a Ne ### Steps -1. Update information of available charts locally from chart repositories. +1. Update the information of available charts locally from chart repositories. ```bash helm repo update @@ -169,7 +169,7 @@ You have created a Nebula Graph cluster with Helm. For details, see [Create a Ne The value of `--set nebula.version` specifies the version of the cluster you want to upgrade to. -4. After waiting for a while, run the following command to check the status and version of the upgraded cluster. +4. Run the following command to check the status and version of the upgraded cluster. Check cluster status: