Kubernetes CreateContainerConfigError: inspect configuration before startup
CreateContainerConfigError
CreateContainerConfigError means the kubelet could not build the configuration needed to start a container. Missing ConfigMaps, Secrets, or required keys are common causes, but this status also covers other configuration failures. Read the container's waiting message and Pod events to identify the exact object or setting involved.
An envFrom, configMapKeyRef, or secretKeyRef reference names an object that does not exist in the same namespace as the Pod.
The referenced object exists, but a required key is absent or differs in capitalization from the key in the workload template.
The kubelet cannot prepare another part of the container configuration, such as a volume subPath or a security context consistent with the image.
Deployment ordering or generated resource names leave a Pod referring to an old configuration name before the intended configuration has been created.
How to fix it
Start with kubectl describe pod POD -n NAMESPACE. Read the Waiting reason and message for the affected container and the recent Events. A message identifying a missing Secret or key is more actionable than the summary status. Container logs may not exist because startup has not occurred.
Inspect the owning workload's env, envFrom, volumes, and volumeMounts references. Compare exact names and namespaces with kubectl get configmap NAME -n NAMESPACE or kubectl get secret NAME -n NAMESPACE. Check the rendered Helm or Kustomize output when generated names differ from the source manifest.
Confirm required key names without exposing their values. For example, kubectl describe secret NAME -n NAMESPACE shows keys and byte counts. Avoid copying Secret YAML or decoded credentials into tickets, terminal recordings, or public troubleshooting tools.
Restore the intended configuration through its normal deployment or secret-management process, or correct the workload reference. Do not mark a required credential optional merely to make the Pod start. If the event instead names subPath or runAsNonRoot, investigate that setting and the image's requirements rather than creating unrelated Secrets.
Observe the next startup attempt after the dependency is repaired. For a changed Pod template, verify the new rollout uses the corrected names. Environment variables in already-running containers do not refresh automatically when a ConfigMap or Secret changes; plan a controlled rollout when those values must change.