【问题标题】:Helm install fails with "rendered manifests contain a resource that already exists" (ClusterRole)Helm 安装失败并显示“渲染的清单包含已存在的资源”(ClusterRole)
【发布时间】:2020-06-05 17:48:41
【问题描述】:

我正在创建一个可以安装在多个命名空间中的 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 忽略这些现有资源?

【问题讨论】:

    标签: kubernetes kubernetes-helm


    【解决方案1】:

    根据documentation

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

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

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

    【讨论】:

      猜你喜欢
      • 2022-09-30
      • 1970-01-01
      • 2019-12-16
      • 1970-01-01
      • 2015-10-09
      • 2022-06-17
      • 2020-04-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多