Skip to main content

Claude Prompt for a Kubernetes Troubleshooting Runbook

Systematic Kubernetes debugging runbook to diagnose pod failures, networking issues, resource exhaustion, and safe deployment rollbacks.

Füllen Sie die Platzhalter aus

Edit the values, then copy your finished prompt.

Ihr Prompt
prompt.txt

                                

What this prompt does

This prompt turns the AI into a systematic Kubernetes troubleshooting runbook for a specific incident. You describe the [issue_description], the [cluster_type], the affected [workload_name], and its [namespace], and the model produces an ordered diagnostic path: initial kubectl triage, pod-level debugging keyed to your [pod_status], networking checks, resource analysis, a recent-changes audit, rollback commands, and a post-incident template.

The structure works because it enforces the order an experienced operator actually follows under pressure — describe, logs, events, then resource and networking checks before anyone touches a rollback. By anchoring step two to the real [pod_status] (for example CrashLoopBackOff), the model gives you the right branch of the diagnostic tree instead of a generic list. Naming [workload_name] and [namespace] means every command is copy-paste ready rather than a template you still have to fill in, which matters when you are debugging live and do not want to be editing placeholders. Anchoring the whole runbook to one [cluster_type] also means the commands account for that platform's quirks instead of staying generic.

When to use it

  • A workload is crash-looping or failing right after a deployment and you need a calm, ordered path through it.
  • Pods are stuck in a specific state like CrashLoopBackOff, ImagePullBackOff, or Pending and you want the matching checklist.
  • A service is unreachable and you need to walk Services, Endpoints, NetworkPolicies, and DNS in order.
  • Nodes look under pressure and you need to confirm whether it is a capacity or quota problem.
  • You need the exact rollback commands and a way to verify the rollback actually succeeded.
  • You want a post-incident action-items template so the same issue class does not recur.

Example output

Expect a runbook-shaped response: numbered sections, each with the specific kubectl get/describe/logs/events commands to run, a branching diagnostic tree for the [pod_status] you supplied, networking and resource checks, rollback commands with a verification step, and a fill-in post-incident template at the end. It reads like a checklist you can follow top to bottom during an incident.

Pro tips

  • Be precise with [issue_description]; "pods crash-looping after the latest deploy" yields a far better tree than "app is down."
  • Always set [pod_status] to the actual state from kubectl get pods so step two branches correctly instead of covering every failure mode.
  • Fill [cluster_type] honestly — EKS, GKE, and bare-metal differ on node, IAM, and networking specifics, and the model tailors commands accordingly.
  • Use the exact [workload_name] and [namespace] so the generated commands need no editing mid-incident.
  • Run the diagnosis steps before the rollback step even when rollback feels obvious; the audit often reveals a config change you would otherwise repeat.
  • Save the generated post-incident template into your repo so the runbook compounds over time rather than being regenerated each outage.
  • Re-run the prompt with an updated [issue_description] if the first diagnosis points somewhere new; treating it as iterative beats forcing one pass to cover every symptom at once.

Frequently Asked Questions

Does it give me the actual kubectl commands or just describe what to do?
It generates the specific `kubectl get`, `describe`, `logs`, and `events` commands using your `[workload_name]` and `[namespace]`, so they are copy-paste ready. That is why supplying the real workload and namespace matters rather than leaving placeholders.
Will it help if my pods are stuck in CrashLoopBackOff?
Yes — set `[pod_status]` to CrashLoopBackOff and the prompt walks the matching diagnostic tree, covering image pull errors, resource limits, liveness probe failures, and OOMKilled analysis. The branch you get depends on the status you provide.
Does it cover networking issues, not just crashing pods?
It includes a dedicated networking section that checks Services, Endpoints, NetworkPolicies, and DNS resolution step by step. Use it when the symptom is connectivity rather than a restarting container.
Can it tell me how to safely roll back a bad deployment?
It provides rollback commands to return the deployment to the last known good state plus a verification step to confirm the rollback worked. The prompt deliberately puts diagnosis before rollback so you understand the cause first.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

Mehr in Docker & Kubernetes Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

Claude Code Expert · Online

👋

Hey there!

Quick Actions

WhatsApp Instant reply

Chat on WhatsApp

+880 1723 741224 · Instant reply

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

[email protected]

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support