+-
Helm安装失败,“渲染的清单包含已存在的资源”(ClusterRole)

我正在创建可以在多个名称空间中安装的Helm图表。除其他资源外,它还包括ClusterRole。

一旦将图表正确安装在一个命名空间中,我尝试将其安装在另一个命名空间中,但是无法抱怨已经存在的ClusterRole:

Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: kind: ClusterRole, namespace: , name: config-reader
helm.go:76: [debug] existing resource conflict: kind: ClusterRole, namespace: , name: config-reader

这里的解决方法是什么?有没有办法强迫Helm忽略这些现有资源?

0
投票

根据documentation

ClusterRole,相比之下,是一个没有命名空间的资源。

如果要在名称空间中定义角色,请使用角色;如果要在整个集群范围内定义角色,请使用ClusterRole。

因此,您可以为ClusterRole使用变量名称,或使用lookup检查资源是否已经存在。