I need to install the same helm Chart to different namespaces, so multiple times. The chart contains cluster scoped resources like ClusterRoles or CustomResourceDefinitions.
The problem is I can only install it once, the second time I have an "already exists not managed by helm" error.
What I've tried:
{{- $crds := lookup "apiextensions.k8s.io/v1" "CustomResourceDefinition" .Release.Namespace "path.to.new.crd" -}}
{{- if not $crds -}}
{{- end }}
But this isn't ideal either, because if I install the same helm to the same namespace twice, the resources get deleted, the third time they appear again, fourth they disappear, and so on.
Does anybody have a more elegant solution to this?