在使用helm install 或者helm upgrade的時候,如果出現了異常中斷操作, 可能會導緻如下報錯
Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
那麼問題來了,如何解決這個問題呢?
參考github上的issues:
https://github.com/helm/helm/issues/8987,我們可以使用以下操作
1.輸入helm history 指令檢查目前狀态, 如下
$ helm history -n lizhewnei lizhewnei-common
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
331 Tue Feb 23 23:11:07 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
332 Wed Feb 24 08:11:08 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
333 Wed Feb 24 15:11:13 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
334 Wed Feb 24 23:11:09 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
335 Thu Feb 25 08:11:09 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
336 Thu Feb 25 15:11:08 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
337 Thu Feb 25 23:11:06 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
338 Fri Feb 26 08:11:13 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
339 Fri Feb 26 09:49:37 2021 deployed lizhewnei-common-0.1.0 1.16.0 Upgrade complete
340 Fri Feb 26 10:37:53 2021 pending-upgrade lizhewnei-common-0.1.0 1.16.0 Preparing upgrade
2.根據上述狀态,我們會發現,最近的一次340部署結果是pending-upgrade 是以阻塞了我們的繼續部署
3.我們使用helm rollback指令回退一個版本到339版本
$ helm rollback -n lizhewnei lizhewnei-common 339
Rollback was a success! Happy Helming!
4.回退之後,再檢查一次目前狀态,确認狀态資訊是回退到339版本
$ helm history -n lizhewnei lizhewnei-common
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
332 Wed Feb 24 08:11:08 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
333 Wed Feb 24 15:11:13 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
334 Wed Feb 24 23:11:09 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
335 Thu Feb 25 08:11:09 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
336 Thu Feb 25 15:11:08 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
337 Thu Feb 25 23:11:06 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
338 Fri Feb 26 08:11:13 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
339 Fri Feb 26 09:49:37 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
340 Fri Feb 26 10:37:53 2021 pending-upgrade lizhewnei-common-0.1.0 1.16.0 Preparing upgrade
341 Fri Feb 26 11:00:23 2021 deployed lizhewnei-common-0.1.0 1.16.0 Rollback to 339
5.這個時候,我們再去使用helm upgrade指令,就可以正常的更新了,更新之後,我們通過helm history 也可以檢查到更新成功,
$ helm history -n lizhewnei lizhewnei-common
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION
333 Wed Feb 24 15:11:13 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
334 Wed Feb 24 23:11:09 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
335 Thu Feb 25 08:11:09 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
336 Thu Feb 25 15:11:08 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
337 Thu Feb 25 23:11:06 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
338 Fri Feb 26 08:11:13 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
339 Fri Feb 26 09:49:37 2021 superseded lizhewnei-common-0.1.0 1.16.0 Upgrade complete
340 Fri Feb 26 10:37:53 2021 pending-upgrade lizhewnei-common-0.1.0 1.16.0 Preparing upgrade
341 Fri Feb 26 11:00:23 2021 superseded lizhewnei-common-0.1.0 1.16.0 Rollback to 339
342 Fri Feb 26 11:01:27 2021 deployed lizhewnei-common-0.1.0 1.16.0 Upgrade complete