Helm错误:升级失败:呈现的清单包含一个已经存在的新资源 [英] Helm Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists

查看:231
本文介绍了Helm错误:升级失败:呈现的清单包含一个已经存在的新资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上一次升级失败时,我会遇到此错误.

I have this error when the previous upgrade failed.

如果不手动删除所有吊舱和服务,我将无法升级.

I cannot upgrade without deleting manually all my pods and services.

Error: UPGRADE FAILED: rendered manifests contain a new resource that already exists.
Unable to continue with update: existing resource conflict: namespace: ns-xy, name: svc-xy, existing_kind: /v1, Kind=Service, new_kind: /v1, Kind=Service

我尝试了 helm upgrade --force ,但没有成功.

I tried with helm upgrade --force but with no success.

一种解决方案是删除所有更新的服务和部署,但这很长,并且会造成长时间的中断.

One solution is to delete all the services and deployments updated, but that's long and creates a long interruption.

如何强制升级?

推荐答案

OP没有提到当前使用的头盔版本是什么.因此,假设您使用的版本早于3.1.0:

OP doesn't mention what is the version of helm currently being used. So, assuming that you are using a version earlier than 3.1.0:

KIND=deployment
NAME=my-app-staging
RELEASE=staging
NAMESPACE=default
kubectl annotate $KIND $NAME meta.helm.sh/release-name=$RELEASE
kubectl annotate $KIND $NAME meta.helm.sh/release-namespace=$NAMESPACE
kubectl label $KIND $NAME app.kubernetes.io/managed-by=Helm 

  • 像以前一样运行头盔升级命令.
  • 这应该告诉Helm,可以接管现有资源并开始对其进行管理.该过程也适用于api升级(例如将"apps/v1beta2"更改为"apps/v1")或将旧元素加入命名空间.

    This should tell Helm that it is okay to take over existing resource and begin managing it. That procedure also works for api upgrades (like "apps/v1beta2" changed to "apps/v1") or onboarding old elements in a namespace.

    这篇关于Helm错误:升级失败:呈现的清单包含一个已经存在的新资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆