How would you test chart templates in CI without a cluster?
IntermediateScenarioChart Design & Authoring
Answer
Situation read → You want fast feedback on template changes on every PR.
What I'd do →
helm lint --strictagainst each environment's values files.helm templatefor each environment piped intokubeconform -strictfor schema validity.- helm-unittest suites asserting specific output (selector labels, replicas absent when HPA enabled, image tag).
- Policy checks with Conftest/Kyverno CLI (non-root, limits set).
- Golden-file diffs: commit rendered output and fail if it changes unexpectedly.
Why → These layers catch syntax, schema, logic and policy errors in seconds.
Interview tip → Name helm-unittest and kubeconform explicitly.
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