$ helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION nginx default 1 2022-02-09 05:49:30.314746649 +0800 CST deployed nginx-0.1.0 1.21
# 查看状态 $ helm status nginx NAME: nginx LAST DEPLOYED: Wed Feb 9 05:24:00 2022 NAMESPACE: default STATUS: deployed REVISION: 1 NOTES: 1. Get the application URL by running these commands: export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=nginx,app.kubernetes.io/instance=nginx" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo"Visit http://127.0.0.1:8080 to use your application" kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
# 修改nginx/Chart.yaml中version: 0.2.0 $ helm package nginx Successfully packaged chart and saved it to: /home/xinchen/nginx-0.2.0.tgz
# 升级 $ helm upgrade nginx nginx-0.2.0.tgz -n default --dry-run --debug # 尝试升级,并未真正升级 $ helm upgrade nginx nginx-0.2.0.tgz $ helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION nginx default 2 2022-02-09 05:58:19.435396187 +0800 CST deployed nginx-0.2.0 1.21
# 回滚 helm rollback [RELEASE] [REVISION] # 回滚命令的第一个参数是发布的名称,第二是修订(版本)号,如果省略此参数,会回滚到上一个版本 # 要查看修订号,执行'helm history RELEASE' $ helm rollback ngin $ helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION nginx default 3 2022-02-09 06:02:25.224998651 +0800 CST deployed nginx-0.1.0 1.21