如何告诉头盔不要创建/更改资源(如果已经存在)? [英] How to tell helm to not create/change resource if it already exists?

查看:63
本文介绍了如何告诉头盔不要创建/更改资源(如果已经存在)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个秘密资源模板,该模板在安装时会为数据生成随机值.

I have a secret resource templates that upon installation will generate random values for the data.

在删除该图表(由于那些存在的情况下,它并没有删除秘密资源)并稍后重新安装之后,我遇到了问题.

I run into a problem after removing that chart (which did not delete the secret resource, because those stay), and reinstalling it later.

这导致它以新生成的数据运行在先前的机密上,对于我而言,这是不希望的.

That caused it to run over the previous secret with newly generated data, which is not desired in my case.

我正在尝试查找需要在模板中包含的if条件,以便它不会创建或修改秘密(如果已经存在).我该怎么办?

I'm trying to find what is the if condition I need to include in the template so that it will not create or modify the secret if it already exists. How do I do that?

推荐答案

从helm 3.1版本开始,有一个查找功能可用于检查给定资源是否存在.使用此功能,您可以跳过升级或安装已经存在的资源.

From helm 3.1 version onwards, there is a lookup function available to check if the given resource exists or not. Using this function you can skip the upgrading or installing a resource if it already exists.

查找函数

这篇关于如何告诉头盔不要创建/更改资源(如果已经存在)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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