helm 问题解决 —— HELM部署异常:Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress

转载: https://blog.csdn.net/dreamer_chen/article/details/118596034

 

 

HELM部署异常:Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress
异常造成原因
在jenkins使用helm部署到k8s集群时,强行停止jenkins任务,第二次重新触发部署时,会造成改异常:Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress

解决方式
登陆到k8s机器中执行:
1
helm list -n [namespace]

其中[namespace]处输入对应的命名空间,会显示出当前命名空间下所有的server。
helm history -n [namespace] [name]

其中[name]为步骤1获取的name,显示所有的部署版本
helm uninstall-n [namespace] [name]
删除该server重新部署即可
————————————————
版权声明:本文为CSDN博主「dreamer_chen」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/dreamer_chen/article/details/118596034

 

 

原文2:https://dev.to/mxglt/how-to-fix-helms-upgrade-failed-has-no-deployed-releases-error-5cbn

 

 

 

How to fix Helm's "Upgrade Failed: has no deployed releases" error

Problems Encountered (13 Part Series)

When you are using the command helm upgrade --install, you may think that it will always work and rollback in case of a failure. But sometimes, it happens that another error can appear.

Upgrade error

Error: UPGRADE FAILED: "..." has no deployed releases

The first time you will see it, you may don't understand what's going on. Especially if it's you already install multiple release of a project with the same command, because you will see all your elements on your cluster and the secrets related to each releases.

How to correct it

Update secret

To correct it, it's quite easy. You just need to update the last secret related to your release.

In it, there is a label called status.

Change its value to deployed, then reuse your "helm upgrade --install" command and it will works !

Use a Kubernetes command

You can use the following command to resolve your issue directly

kubectl patch secret [release secret] --type=merge -p '{"metadata":{"labels":{"status":"deployed"}}}' -n [namespace]

Recreate release

Another way to correct this issue is to delete the release

helm uninstall [release name]

and reinstall it.

helm install [release name] ...

or

helm upgrade --install [release name] ...

⚠ WARNING ⚠

If you are using this solution, you must be aware that the service deployed with the release will be unavailable during a period of time!

I'm talking about this possibility, just let you aware about this possibility.


I hope it will help you! 🍺

posted @ 2022-11-18 16:25  PanPan003  阅读(2012)  评论(0编辑  收藏  举报