How do you pass a different config per environment with one set of manifests?
IntermediateScenarioConfiguration, Secrets and storage
Answer
Situation read → Dev, staging and prod differ only in replicas, hostnames and limits.
What I'd do →
- Use Kustomize with
base/andoverlays/dev|staging|prod - Patch values with
patchesandconfigMapGenerator - Or Helm with one
values-<env>.yamlper environment - Render with
kustomize build overlays/prodorhelm templatein CI - Validate with
kubeconform
Why → Base plus overlays keeps duplication low and differences reviewable.
Interview tip → Say you never copy-paste manifests per environment.
More on Configuration, Secrets and storage
How do you inject configuration into pods and what are the options?BeginnerA ConfigMap was updated but the pod still shows old values. Why?IntermediateHow do you store a database password safely in Kubernetes?BeginnerHow do you manage secrets in GitOps without committing them in plain text?IntermediateA pod fails with `CreateContainerConfigError` and a missing key. What happened?BeginnerWhat is the difference between emptyDir, hostPath, PV/PVC and when do you use each?Beginner