Kubernetes deployment stuck in CrashLoopBackOff with immediate restarts and no useful logs
Environment
On-premise Kubernetes cluster (v1.27), containerd runtime, deployment with 3 replicas, app is a Node.js service with a custom entrypoint and mounted ConfigMap for runtime config.
Symptoms
kubectl get pods shows Restarting and CrashLoopBackOff. kubectl logs <pod> returns empty or only container runtime start lines. No application stack trace is present in logs.
Observations
Deployment defines readiness and liveness probes with initialDelaySeconds 5; probes are relatively strict. Pod spec includes a volume mount of a ConfigMap at /app/config. Restart occurs within 1–2 seconds of container start. InitContainers are not defined.
Already attempted
Temporarily removed liveness/readiness probes and redeployed; pods still crash immediately. Created a single-replica Deployment and scaled to 1; same behavior. Rebuilt image locally and ran container successfully on dev host.
Diagnostic steps
- Inspect pod events and termination reason: kubectl describe pod <pod>.
- What the result means: If the container terminationReason or reason field shows 'Completed' or 'Error' without OOMKilled, it indicates the process exited by itself. Events may show image pull or mount errors if present.
- Start a debugging pod with the same image and override the command to sleep (kubectl run --rm -it --image ... --command -- /bin/sh -c 'sleep 1d') and inspect the filesystem and mounted ConfigMap inside the container.
- What the result means: If the ConfigMap files are absent or have wrong contents/permissions inside the debugging container when mounted the same way, the mount configuration is likely the culprit. If files are present and correct, entrypoint/script behavior should be tested interactively.
- Run the container locally with the same environment variables and bind-mount the ConfigMap contents to reproduce startup with a shell: docker run --rm -it -v $(pwd)/config:/app/config image /bin/sh and then run the entrypoint manually.
- What the result means: If the entrypoint fails interactively, its stderr will show the early error. If it succeeds locally with the same files, the issue likely lies in how Kubernetes mounts or the runtime restricted capabilities.
- Enable higher verbosity for kubelet/container runtime logs on the node where pod runs and inspect containerd logs for create/start errors.
- What the result means: Runtime logs can reveal permission denied or OCI runtime errors that are not surfaced to pod logs. If runtime refuses to start container due to RLIMIT or seccomp policy, it will appear here.
Confirmed fixes
No fix has been independently verified for this scenario. Treat the causes below as diagnostic hypotheses.
Question
What diagnostics will reveal whether the crash is caused by the container entrypoint, missing/misread configuration mounts, or a startup race that prevents logging before process exit?
Verified community troubleshooting
No answers yet..
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Cloud Computing35% match
Kubernetes deployment stuck in CrashLoopBackOff immediately after rollout
Open1 answer - Cloud Computing22% match
Kubernetes nodes fail to pull container images after containerd overlay storage filled on GKE-like cluster
Open0 answers - Programming21% match
Prisma P1001: cannot reach database server from deployed Node service
Open1 answer - Cloud Computing21% match
Kubernetes pods OOMKilled while node shows 80GB free memory on Ubuntu 20.04 (kubelet+Docker cgroup mismatch suspected)
Open0 answers - Cloud Computing20% match
Kubernetes PVCs stuck Pending after node migration — CSI node plugin fails to register with kubelet
Open0 answers