feat(helm): scope ClusterRole/ClusterRoleBinding names by release namespace - #2939
feat(helm): scope ClusterRole/ClusterRoleBinding names by release namespace#2939bsquizz wants to merge 2 commits into
Conversation
38b9064 to
2bd01b8
Compare
|
Thanks for addressing the cluster-scoped RBAC ownership conflict. I manually rendered the chart for both namespaces and confirmed the names remain internally consistent:
A few items to address before merge:
The template changes themselves look correct: the binding name and |
…espace The chart creates cluster-scoped ClusterRole and ClusterRoleBinding resources with a fixed name derived from the release name. When multiple Helm releases coexist on the same cluster (multi-tenant), only one release can own these resources due to Helm ownership annotations -- the second install fails with a conflict. Append .Release.Namespace to the ClusterRole and ClusterRoleBinding names so each release gets its own cluster-scoped resources. The duplication is harmless (the rules are identical and small) and eliminates multi-tenant conflicts entirely without requiring external RBAC management. Signed-off-by: Brandon Squizzato <bsquizza@redhat.com>
Assert the generated ClusterRole name, ClusterRoleBinding name, and roleRef all include the release namespace suffix so multi-namespace installations cannot silently regress to conflicting fixed names. Signed-off-by: Brandon Squizzato <bsquizza@redhat.com>
2bd01b8 to
4edb5cd
Compare
|
Implemented feedback and re-tested successfully in our e2e setup |
Summary
.Release.Namespaceto the ClusterRole and ClusterRoleBindingmetadata.namefields inclusterrole.yamlandclusterrolebinding.yamlopenshell-gateway-node-reader-ns-a,openshell-gateway-node-reader-ns-b), eliminating ownership annotation conflicts in multi-tenant deploymentsMotivation
The chart creates a
ClusterRoleandClusterRoleBindingwith a fixed name (openshell-gateway-node-reader). Helm tracks ownership viameta.helm.sh/release-namespaceannotations. When two releases coexist on the same cluster (e.g. HyperShell deploying multiple gateways), the second install fails:Scoping the names by namespace makes each release's cluster-scoped resources independent. The rules are identical and small, so the duplication is harmless.
Test plan
helm template -n ns-arendersopenshell-gateway-node-reader-ns-afor both ClusterRole and ClusterRoleBindinghelm template -n ns-brendersopenshell-gateway-node-reader-ns-bhelm upgradecreates the new named resources; the old fixed-name resources can be cleaned up manually or left as orphans🤖 Generated with Claude Code