Pular para o conteúdo
Skillpedia
Deploy e nuvem (DevOps)5,1 mil · #15047

k8s-debug-gpu-pod

O que ela faz

Verifica todos os pods com problema em um namespace e descobre a causa a partir de eventos, agendamento, recursos, download de imagens e falhas. Ela é para quem roda pods no Kubernetes, incluindo pods de GPU.

Quando usar

  • ✓Quando um pod do Kubernetes está preso em Pending.
  • ✓Quando um pod continua falhando com CrashLoopBackOff.
  • ✓Quando um pod não consegue baixar a imagem e mostra ImagePullBackOff.

Link da skill

https://github.com/Project-HAMi/HAMi/blob/master/skill/k8s-debug-gpu-pod/SKILL.md

Copie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.

Como usar

O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.

Mensagem pronta para colar

Use esta skill para me ajudar: https://github.com/Project-HAMi/HAMi/blob/master/skill/k8s-debug-gpu-pod/SKILL.md Leia o arquivo SKILL.md desse link e siga as instruções dele na minha tarefa.
Quer que a sua IA encontre skills como esta sozinha?Instale o MCP grátis do Skillpedia: uma linha, e ela pesquisa entre 15.000+ skills antes de cada tarefa.Instalar em 1 minuto →

Exemplo do que pedir para a IA

“Alguns pods no meu namespace gpu estão presos em Pending. Descubra por que e o que corrigir.”

5 skills novas por semana. 1 minuto de leitura.

Como funciona

O agente pede o namespace e o contexto do cluster, verifica o estado de todos os pods e depois confere os eventos e detalhes de cada pod com problema. Ele informa a causa raiz de cada um.

Conteúdo técnico (SKILL.md original)

Texto original do autor, em inglês, direto do GitHub.

Interaction

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

Input Required Default
Namespace Yes —
Kubeconfig file path No ~/.kube/config
Context name No current-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:

Event Reason Points to
FailedScheduling Step 3 (Pending)
CrashLoopBackOff / BackOff Step 4 (Crash)
ImagePullBackOff / ErrImagePull Step 5 (Image)
OOMKilled Step 4 (Crash)
FailedAttachVolume / FailedMount PVC issue — note in report
Unhealthy Probe misconfiguration — note in report
Evicted Node pressure — note in report
NodeNotReady Infrastructure issue — note in report

Short-circuit rule: If events clearly point to a single root cause (e.g., all events are FailedScheduling with the same message), mark it as the confirmed primary cause but still scan remaining steps at reduced depth for additional findings.

Step 3: Pending Pod Root Cause Analysis

For each Pending pod:

kubectl describe pod <pod-name> -n <namespace>

Parse the Events and Conditions sections. Common causes:

Event Message Pattern Root Cause Remediation
Insufficient cpu / Insufficient memory Resource exhaustion Reduce requests, scale cluster, or check quota (→ Step 6)
0/N nodes are available + taint Taint/toleration mismatch Add toleration or untaint node
0/N nodes are available + node selector No matching nodes Fix nodeSelector or add matching nodes
0/N nodes are available + affinity Affinity rule unsatisfiable Relax affinity rules
persistentvolumeclaim "X" not found Missing PVC Create PVC or fix claim name
pod has unbound immediate PersistentVolumeClaims PVC not bound Check StorageClass and PV availability
exceeded quota Quota limit hit → Step 6

Step 4: CrashLoopBackOff / Error Diagnosis

Only execute if Step 1 found pods in CrashLoopBackOff or Error state.

A. Termination reason:

kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.status.containerStatuses[*].lastState.terminated}'
Termination Reason Root Cause Remediation
OOMKilled Memory limit exceeded Increase memory limits, profile usage
exitCode 1 Application failure Check logs, configs, secrets, dependencies
exitCode 137 SIGKILL / OOM Check node pressure and memory
exitCode 139 Segfault Debug binary compatibility
exitCode 143 SIGTERM not handled Review graceful shutdown

B. Logs (current + previous):

kubectl logs <pod-name> -n <namespace> --tail=100
kubectl logs <pod-name> -n <namespace> --previous --tail=100

C. Resource config:

kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.spec.containers[*].resources}' | jq .

D. Restart count:

kubectl get pod <pod-name> -n <namespace> -o jsonpath='{.status.containerStatuses[*].restartCount}'

High restart count (>5) combined with short uptime indicates persistent failure — check probes, dependencies, and startup ordering.

Perguntas frequentes

Preciso dizer o nome do pod?

Não. A skill encontra sozinha todos os pods com problema no namespace.

Qual cluster ela usa?

O kubeconfig e o contexto que você fornecer ou, se você deixar em branco, o padrão do seu kubeconfig.

Ela cobre erros de download de imagem?

Sim. Tem uma etapa específica para os erros ImagePullBackOff e ErrImagePull.

Detalhes

Descrição original do autor

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.

repo: Project-HAMi/HAMi

Popularidade

Estrelas no GitHub
5,1 mil
Posição no ranking
#15047
Licença
Apache-2.0
Atualizada em
02/11/2026

Essa skill é útil?

0

Entre para votar.

Comentários

  • …

Mais skills deste repositório

Skills parecidas