Your pod is in CrashLoopBackOff. You've seen this before: you run kubectl rollout restart deployment, the pod comes back, and for a while everything looks fine. Until it doesn't. The cycle repeats, and each restart hides the real problem a little deeper.
The myth says a restart is enough — "it'll come up on its own." The truth is that CrashLoopBackOff is a symptom, not a diagnosis. The cause lives in the events, the resource limits, the liveness probe, the ConfigMap, or the image. An LLM can help you find it — but only if you feed it raw describe output, logs from the previous container, and the manifest. Ask it to "fix Kubernetes" and you'll get generic advice. Ask it to analyze specific data and you'll get hypotheses with commands to verify them.
This roundup is a set of prompts for those moments when you're staring at a crashing pod and need to move from guesswork to evidence.
When You Have Only kubectl describe and No Logs
Sometimes the container dies so fast that kubectl logs returns nothing. That's when kubectl describe pod becomes your primary source. It shows events, container states, exit codes, and resource limits. The trick is to make the LLM read it like a detective, not like a search engine.
Prompt:
You are a Kubernetes debugging assistant. I will paste the output of kubectl describe pod <name>. Your task is to identify the most likely root cause of the CrashLoopBackOff. Focus on: (1) the Last State section — exit code and reason; (2) Events — look for FailedMount, FailedScheduling, Unhealthy, BackOff; (3) resource requests/limits vs node capacity; (4) probe configurations. Do not suggest restarting the pod. Instead, list 2–3 hypotheses ranked by probability, and for each give a specific command to confirm or refute it. Output in a table: Hypothesis
| Evidence from describe | Verification command.
Usage example: You paste a describe output where the container exited with code 1 and the events show Liveness probe failed: HTTP probe failed with statuscode: 503. The LLM might hypothesize that the app takes longer to start than the initialDelaySeconds allows, and suggest checking the probe timings against the application startup logs.
When You Have Logs from the Previous Container
Logs from the crashed container are more valuable than logs from the current one, because the current one may still be starting. Use kubectl logs <pod> --previous to get them. But raw logs can be noisy — that's where the LLM earns its keep.
Prompt:
Here are the last 100 lines of logs from the previous container instance of a pod in CrashLoopBackOff. The container exited with code <code>. Analyze the logs and tell me: (1) the last successful operation before the crash; (2) any error messages, stack traces, or exceptions; (3) whether the crash looks like a configuration issue, a code bug, a dependency failure, or a resource limit. Then propose the next diagnostic step — a command or a file to inspect. Do not suggest restarting the pod.
Usage example: The logs end with FATAL: password authentication failed for user "app". The LLM concludes it's a configuration issue — likely a wrong secret or environment variable — and suggests checking the Deployment's env vars against the Secret's keys.
When the Manifest Is the Suspect
Sometimes the logs are clean and the describe output looks normal, but the pod still crashes. That's when you need to look at the manifest — especially resource limits, probes, and volume mounts. An LLM can cross-check the manifest against the symptoms.
Prompt:
I have a Deployment manifest and a pod in CrashLoopBackOff. The pod events show <event summary>. The container exits with code <code>. Review the manifest for: (1) resource requests/limits that might cause OOMKilled or CPU throttling; (2) liveness/readiness probe settings that might kill a slow-starting app; (3) volume mounts or ConfigMap/Secret references that might be missing or misconfigured; (4) image pull policy or tag issues. For each potential issue, explain why it could cause the crash and give a command to verify. Output as a checklist.
Usage example: The manifest sets resources.limits.memory: 128Mi, but the app is a Java service that needs at least 256Mi to start. The LLM flags the limit as too low and suggests checking kubectl top pod or the OOMKilled event.
When You Need to Compare a Working Pod with a Failing One
If the same application runs fine in staging but crashes in production, the difference is in the environment. An LLM can compare two describe outputs or two manifests and highlight the discrepancies.
Prompt:
I have two pods running the same image: one is healthy, one is in CrashLoopBackOff. Below are their `kubectl describe` outputs (or manifests). Compare them and list every difference that could explain the crash: environment variables, resource limits, volumes, node selectors, probe settings, image tags. Rank the differences by likelihood of causing the crash. For the top difference, give a command to test it.
Usage example: The healthy pod has env: LOG_LEVEL=debug, the failing one has LOG_LEVEL=info. That seems harmless, but the LLM notices that the failing pod also lacks a volume mount for a cache directory, which the app needs for startup.
When You Suspect OOMKilled but Aren't Sure
OOMKilled is a specific exit code (137) and a specific event. But sometimes the pod restarts without a clear OOM event. An LLM can help you differentiate between OOMKilled, a failed liveness probe, and an application crash.
Prompt:
My pod is in CrashLoopBackOff. The describe output shows exit code <code> and the events include <events>. The logs show <summary>. Determine whether this is likely OOMKilled, a liveness probe failure, or an application error. Explain your reasoning. If OOMKilled, suggest how to right-size the memory limit using the container's actual usage (if available). If probe failure, suggest adjusted probe parameters. If application error, point to the relevant log lines.
Usage example: Exit code 137 with no OOM event but a liveness probe failure in events. The LLM explains that the probe may be killing the container before it can OOM, and suggests increasing initialDelaySeconds and checking memory usage with kubectl top pod.
When You Want to Prevent the Next CrashLoopBackOff
Once you've found the cause, the next step is to make sure it doesn't happen again. An LLM can help you write a post-mortem or adjust the manifest to be more resilient.
Prompt:
Based on the diagnosis that the CrashLoopBackOff was caused by <cause>, suggest changes to the Deployment manifest to prevent recurrence. Consider: resource limits, probe settings, pod disruption budgets, and startup probes. Provide the updated YAML snippet and explain each change. Also suggest a monitoring alert that would catch this earlier.
Usage example: The cause was a missing ConfigMap. The LLM suggests adding a startupProbe to give the app more time and an alert on kube_pod_container_status_restarts_total.
The Bottom Line
CrashLoopBackOff is not a problem to be restarted away — it's a signal that something in your configuration, resources, or code is wrong. The prompts above are designed to turn an LLM into a diagnostic partner that reads the evidence you provide and gives you actionable hypotheses, not generic advice.
The next time a pod crashes, resist the urge to hit restart. Instead, gather the describe output, the previous logs, and the manifest, and ask the LLM the right questions. You'll spend less time guessing and more time fixing.
For a deeper dive into Kubernetes debugging with LLMs, check out our related articles:
- The Pod Is Not Broken — Your Diagnosis Is: Prompts That Make an LLM Read CrashLoopBackOff Before Touching the Restart Button
- Your Pod Is CrashLooping and Your Pipeline Is Red: LLM Prompts That Cut the Guesswork
- Before the Cluster Falls: LLM Prompts That Read Pods, Helm Charts, and Resource Limits Better Than a Tired On-Call
- From CrashLoopBackOff to a Working Helm Chart: 12 Prompts That Turn an LLM Into Your Kubernetes Sidekick
- CKA + CKAD — Kubernetes Administrator & Developer: How to Fix CrashLoopBackOff and a Pod That Won't Start