在使用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