Interview Prep/Helm/Chart Design & Authoring

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 →

  1. Add two independent blocks: ingress.enabled and httpRoute.enabled, each with its own template.
  2. Guard the HTTPRoute with .Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1/HTTPRoute" and fail with a clear message if enabled but missing.
  3. Share host and path values through a helper so both render from the same source.
  4. 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.

All Helm questions Roadmap: Helm

More on Chart Design & Authoring