Interview Prep/Kubernetes/Configuration, Secrets and storage

A pod fails with `CreateContainerConfigError` and a missing key. What happened?

BeginnerScenarioConfiguration, Secrets and storage
Answer

Situation read → Event says couldn't find key DB_HOST in ConfigMap default/app-config.

What I'd do →

  1. kubectl describe pod and read the message
  2. kubectl get cm app-config -o yaml to see actual keys
  3. Fix the key name or add the key
  4. Use optional: true only if the value is truly optional
  5. Re-create the pod or let the Deployment retry

Why → The kubelet cannot build the container environment when a referenced key or object is missing.

Interview tip → Same error appears for missing Secrets.

All Kubernetes questions Roadmap: Kubernetes core

More on Configuration, Secrets and storage