Interview Prep/Helm/Chart Design & Authoring

The chart must support an optional sidecar (log shipper) that some environments need. How do you add it cleanly?

IntermediateScenarioChart Design & Authoring
Answer

Situation read → Optional container, with its own image, resources and config.

What I'd do →

  1. Add logShipper.enabled, logShipper.image, logShipper.resources in values.
  2. In the pod spec, render the container inside {{- if .Values.logShipper.enabled }}, plus its ConfigMap and shared emptyDir volume.
  3. Alternatively offer generic extraContainers (rendered with tpl (toYaml .Values.extraContainers) .) for any sidecar.
  4. Consider native sidecars (init container with restartPolicy: Always, Kubernetes 1.29+) so it starts before and stops after the app.

Why → A dedicated block for common sidecars, plus a generic escape hatch for rare ones.

Interview tip → Mentioning native sidecars shows you track current Kubernetes features.

All Helm questions Roadmap: Helm

More on Chart Design & Authoring