Two releases of your chart in the same cluster collide on a ClusterRole name. How do you fix the chart?
IntermediateScenarioChart Design & Authoring
Answer
Situation read → Cluster-scoped resources are not namespaced, so a static name like shop-reader is shared by every release and the second install fails with "already exists".
What I'd do →
- Name cluster-scoped objects with release and namespace:
{{ printf "%s-%s" .Release.Namespace (include "shop.fullname" .) | trunc 63 | trimSuffix "-" }}. - Ask whether a namespaced Role is enough; prefer it.
- Make cluster-scoped resources optional (
rbac.clusterWide: false).
Why → Unique names make the chart installable multiple times, which is a basic chart requirement.
Interview tip → Call out CRDs as the one cluster-scoped thing that should be shared, and managed separately.
More on Chart Design & Authoring
Your team has 15 near-identical YAML folders, one per microservice per environment. How do you introduce Helm?BeginnerShould you build one generic chart for all microservices or one chart per service?IntermediateA developer hardcoded `namespace: production` in every template. What is wrong and how do you fix it?BeginnerChanging a ConfigMap value in the chart does not restart the pods, so the app keeps old config. What do you change?IntermediateYou need the same chart to support both Ingress and Gateway API HTTPRoute. How do you design it?IntermediateYour chart's Deployment template has grown to 300 lines of nested `if`s. How do you clean it up?Intermediate