What it means
Before starting a container, the kubelet resolves its environment variables and volumes. If a referenced ConfigMap, Secret or key is missing, the container is never created and the Pod shows CreateContainerConfigError.
Causes and fixes
Most likely first. Run the check, and if it matches, apply the fix.
1. The ConfigMap or Secret doesn't exist in the Pod's namespace (or is misspelled)
Check:
kubectl describe pod <pod> | grep -A3 Events
kubectl get configmap,secret -n <ns>
Fix: Create it in the same namespace, or fix the name in the Pod spec.
2. The object exists but not the key
Check:
kubectl get configmap <name> -o yaml
Fix: Add the key, or mark the reference optional if it really is.
Fix it yourself
A live machine in your browser with this problem already on it. The grader checks the result.
Open the labNo account needed for your first tries.
Related errors
- CrashLoopBackOff
A container keeps exiting, and Kubernetes waits longer and longer before restarting it.