A ConfigMap or Secret the environment refers to does not exist in the pod's namespace
CommonAn env valueFrom or envFrom names an object that is not there: a typo, an object created in another namespace, one not yet applied, or a generated name with a suffix the reference does not use. Pods can only refer to objects in their own namespace.
Confirm
kubectl get events -n <namespace> --field-selector involvedObject.name=<pod>,reason=Failed kubectl get configmap,secret -n <namespace>
Error: configmap "<name>" not found or secret "<name>" not found, and no object of that name in the pod's namespace
Fix
- Create the object in the pod's namespace, or correct the name in the manifest.
- If you create it, wait about 10 seconds: the kubelet retries the same pod and it starts. If you changed the manifest, the workload rolls out new pods instead.
- Apply ConfigMaps and Secrets before, or together with, the workloads that use them.