-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
c71496c
commit 1ebadec
Showing
1 changed file
with
119 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}} | ||
``` |