Skills

K8S Debug Gpu Pod

Use when pods are stuck in Pending, CrashLoopBackOff, or ImagePullBackOff state.

Install

npx skills add Project-HAMi/HAMi --skill k8s-debug-gpu-pod -g -a claude-code -y
Repository
Project-HAMi/HAMi5.1k
Category
Media
Updated
4d ago
License
Apache-2.0
Context cost
Mediumabout 1,764 tokens
Runs scripts
No, instructions only

What it does

Use when pods are stuck in Pending, CrashLoopBackOff, or ImagePullBackOff state. Performs event-driven triage to quickly identify root cause, then deep-dives into scheduling failures, resource exhaustion, image pull errors, and crash loops.

Interaction

Collect the following from the user in a single exchange before starting diagnosis:

InputRequiredDefault
NamespaceYes,
Kubeconfig file pathNo~/.kube/config
Context nameNocurrent-context in the kubeconfig

If the user provides a cluster name instead of a context, fuzzy-match it against available contexts in the kubeconfig and confirm the match.

The skill automatically discovers and diagnoses all unhealthy pods (Pending, CrashLoopBackOff, ImagePullBackOff, Error) in the namespace. No pod name is needed.

Command Convention

All kubectl commands use shorthand below. Actual execution must always include explicit flags:

kubectl --kubeconfig=<kubeconfig> --context=<context> ...

Never rely on default kubeconfig or current-context.

Diagnostic Workflow

Step 1: Global Pod Overview

Get a full picture of all pod states in one command:

kubectl get pods -n <namespace> -o wide

Categorize pods into:

  • ✅ Running/Completed, healthy, skip
  • 🟡 Pending, go to Step 3
  • 🔴 CrashLoopBackOff/Error, go to Step 4
  • 🔴 ImagePullBackOff/ErrImagePull, go to Step 5
  • ⚠️ Other abnormal states, note for report

All unhealthy pods are diagnosed. No manual pod selection needed.

Step 2: Event Triage

Quick scan of recent warning events for immediate signal:

kubectl get events -n <namespace> --field-selector type=Warning --sort-by=.lastTimestamp | tail -50

Use events to guide which deep-dive steps are most relevant. Common event→action mapping:

Read the whole SKILL.md on GitHub

More in Media