《每天5分钟玩转 Kubernetes》11 Helm 升级、回滚 release

已经通过 helm 安装了 mysql,其中的 mysql 版本是 5.7.14,现在想升级到 5.7.15,执行命令:

helm upgrade --set imageTag=5.7.15 mydb stable/mysql

// 返回
Release "mydb" has been upgraded. Happy Helming!
LAST DEPLOYED: Fri Dec 14 07:04:14 2018
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/Secret
NAME        TYPE    DATA  AGE
mydb-mysql  Opaque  2     13m

==> v1/ConfigMap
NAME             DATA  AGE
mydb-mysql-test  1     13m

==> v1/PersistentVolumeClaim
NAME        STATUS  VOLUME    CAPACITY  ACCESS MODES  STORAGECLASS  AGE
mydb-mysql  Bound   mysql-pv  8Gi       RWO           13m

......

提示升级完成,等待一些时间,可以用命令 helm status mydb 查看 release 状态。

查看mysql版本:

kubectl get deployment mydb-mysql -o wide

// 返回
NAME         READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES         SELECTOR
mydb-mysql   1/1     1            0           18m   mydb-mysql   mysql:5.7.15   app=mydb-mysql

版本已经是 5.7.15

查看升级历史:

helm history mydb

// 返回
REVISION    UPDATED                     STATUS      CHART           DESCRIPTION
1           Fri Dec 14 06:50:52 2018    SUPERSEDED  mysql-0.10.2    Install complete
2           Fri Dec 14 07:04:14 2018    DEPLOYED    mysql-0.10.2    Upgrade complete

回滚到版本1:

helm rollback mydb 1

//返回
Rollback was a success! Happy Helming!

查看mysql版本:

kubectl get deployment mydb-mysql -o wide

// 返回
NAME         READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES         SELECTOR
mydb-mysql   1/1     1            1           17m   mydb-mysql   mysql:5.7.14   app=mydb-mysql

版本回到了 5.7.14

你可能感兴趣的:(《每天5分钟玩转 Kubernetes》11 Helm 升级、回滚 release)