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

Create 9.upgrade-nebula-cluster.md #1190

Merged
merged 4 commits into from
Nov 11, 2021
Merged
Changes from 2 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
117 changes: 117 additions & 0 deletions docs-2.0/nebula-operator/9.upgrade-nebula-cluster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# 升级Nebula Graph集群

Nebula Operator支持升级Nebula Graph集群。本文介绍如何升级Nebula Graph集群。
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved

## 前提条件

已创建Nebula Graph集群。具体步骤,参见[使用Kubectl创建Nebula Graph集群](3.deploy-nebula-graph-cluster/3.1create-cluster-with-kubectl.md)。

## 使用限制

只支持升级Nebula Graph 2.5.x至2.6.x版本。
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved

## 操作步骤

本文示例中的被升级集群的YAML名为`apps_v1alpha1_nebulacluster.yaml`,版本为2.5.1。
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved

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:v2.6.1
1 vesoft/nebula-metad:v2.6.1
3 vesoft/nebula-storaged:v2.6.1
```