Interview Prep/Helm/Chart Design & Authoring

How do you make a chart work for both a stateless API and a worker that has no Service?

IntermediateScenarioChart Design & Authoring
Answer

Situation read → Same code base, two run modes; the worker must not get a Service, Ingress or HTTP probes.

What I'd do →

  1. Model components in values: api.enabled, worker.enabled, each with image args, replicas and resources.
  2. Render the Service and Ingress only for api, wrapping each template in {{- if .Values.api.enabled }}.
  3. Give the worker exec or no probes, and its own app.kubernetes.io/component: worker selector label.
  4. Share image settings through a common image block with per-component overrides.

Why → Components keep selectors distinct, so the API Service never routes to worker pods.

Interview tip → Highlight the component label in selectors as the thing that keeps them separate.

All Helm questions Roadmap: Helm

More on Chart Design & Authoring