Interview Prep/Kubernetes/Helm, operators and GitOps

A Helm chart upgrade changed an immutable field and failed. How do you proceed?

AdvancedScenarioHelm, operators and GitOps
Answer

Situation read → Error: field is immutable for a Deployment selector or a Job template.

What I'd do →

  1. Identify the field in the error (spec.selector, spec.template of Job, PVC size, Service clusterIP)
  2. For Jobs delete the old Job first or use ttlSecondsAfterFinished
  3. For selectors, plan a migration: create a new Deployment name and shift traffic
  4. Avoid changing selector labels in chart updates
  5. Use hooks to delete and recreate where acceptable

Why → Kubernetes forbids changing certain fields, so the object must be recreated.

Interview tip → Mention that selector labels should never include chart version.

All Kubernetes questions Roadmap: Platform engineering

More on Helm, operators and GitOps