You need the same chart to support both Ingress and Gateway API HTTPRoute. How do you design it?
IntermediateScenarioChart Design & Authoring
Answer
Situation read → Some clusters run ingress-nginx, newer ones use Gateway API. The chart must not force either.
What I'd do →
- Add two independent blocks:
ingress.enabledandhttpRoute.enabled, each with its own template. - Guard the HTTPRoute with
.Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1/HTTPRoute"andfailwith a clear message if enabled but missing. - Share host and path values through a helper so both render from the same source.
- Add a schema rule that rejects both enabled at once if that is not supported.
Why → Feature flags plus capability checks keep one chart portable across cluster generations.
Interview tip → Mention testing both paths with helm template --api-versions.
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?IntermediateYour chart's Deployment template has grown to 300 lines of nested `if`s. How do you clean it up?IntermediateHow do you make a chart work for both a stateless API and a worker that has no Service?Intermediate