Kubernetes deployment stuck in CrashLoopBackOff immediately after rollout
Environment
Kubernetes cluster (managed control plane), worker nodes running kubelet 1.xx, containerd runtime. Deployment uses a single ReplicaSet, image pulled from internal registry, liveness and readiness probes configured on HTTP endpoints.
Symptoms
kubectl get pods shows STATUS CrashLoopBackOff for the pod; pod restarts every few seconds. The replicaSet reports desired replicas not ready, and readinessProbe prevents service traffic.
Observations
kubectl describe pod shows multiple restarts and event messages about back-off; kubectl logs -p and logs show only the container's short stdout/stderr before exit. No core dumps available on node; liveness probe failures coincide with restarts in events.
Already attempted
Scaled deployment down and up, removed liveness probe temporarily, redeployed with the same image tag, inspected node resource pressure (no OOM or node eviction events), checked ImagePullBackOff (image exists locally on nodes).
Diagnostic steps
- kubectl logs <pod> --previous and kubectl logs <pod> to capture both the failed attempt and current logs. If logs are empty, run kubectl exec into a recreated pod or create a debug pod using the same image and start an interactive shell.
- What the result means: If logs show an application stack trace or explicit configuration error, follow that message. If logs are empty and the container exits before stdout/stderr flush, the issue may be early process failure or PID 1 problems; an interactive shell will allow inspection of files and env.
- Temporarily remove or widen liveness/readiness probe (or set initialDelaySeconds to a high value) and redeploy.
- What the result means: If pod becomes Ready after disabling/widening probes, the probe configuration is killing the container too soon — adjust path, port, timeouts, or startupProbe instead of livenessProbe for slow start.
- Compare Deployment environment variables, mounted ConfigMaps/Secrets and volumes with a local reproduced container (docker run or ctr run) using the same image and env values.
- What the result means: If container runs locally with same config, cluster runtime or node permissions are implicated. If it fails locally with same error, configuration or build is at fault.
- Inspect node-level kubelet and container runtime logs for OOM, seccomp or AppArmor denials and check dmesg for kernel-level kills.
- What the result means: If node logs show OOM or security denials, the container is being killed by the host—adjust resource requests/limits or security profiles. If no node errors, focus on in-container startup behavior.
- Deploy a debug sidecar or an ephemeral pod mounting the same volumes/ConfigMaps as the failing pod and inspect filesystem, expected sockets, and permissions.
- What the result means: If expected files or sockets are missing or owned by wrong user, fix volume mounts or initContainers to create them. If present but inaccessible, adjust ownership or securityContext.
Confirmed fixes
No fix has been independently verified for this scenario. Treat the causes below as diagnostic hypotheses.
Question
What are the most useful diagnostics to determine why the container process exits at startup and how to make the pod remain Ready?
Verified community troubleshooting
Start by widening or disabling the liveness/readiness probes and redeploying to see whether the pod stabilizes; if it does, change probes to startupProbe or adjust paths/timeouts. If probes aren't the problem, run the same image locally with the exact env and mounts to reproduce the startup failure; if it runs locally the node or runtime may be killing it (check dmesg and kubelet logs). Use an interactive debug pod with identical mounts to inspect missing files or permission issues. Verify fixes by observing pods achieve Ready and stay running for several minutes under normal load.
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Cloud Computing29% match
Kubernetes nodes fail to pull container images after containerd overlay storage filled on GKE-like cluster
Open0 answers - Cloud Computing25% match
Kubernetes deployment stuck in CrashLoopBackOff with immediate restarts and no useful logs
Open0 answers - Cloud Computing25% match
Kubernetes pods OOMKilled while node shows 80GB free memory on Ubuntu 20.04 (kubelet+Docker cgroup mismatch suspected)
Open0 answers - Cloud Computing23% match
Kubernetes pods CrashLoopBackOff only on upgraded nodes with hugepages enabled — short lived OOM at container startup
Open0 answers - Cloud Computing23% match
Kubernetes PVCs stuck Pending after node migration — CSI node plugin fails to register with kubelet
Open0 answers