Reputation: 24452
I'm creating a Helm chart that can be installed in multiple namespaces. Among other resources it includes a ClusterRole.
Once the chart is installed correctly in one namespace I try to install it in another one but fails complaining about the already existing 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
What's the workaround here? Is there a way to force Helm to ignore this existing resources?
Upvotes: 3
Views: 8402
Reputation: 6471
According to the documentation
ClusterRole, by contrast, is a non-namespaced resource.
If you want to define a role within a namespace, use a Role; if you want to define a role cluster-wide, use a ClusterRole.
So, Either you can use the variable name for ClusterRole or use lookup to check if the resource already exists.
Upvotes: 1