k8s-debug

Diagnose Kubernetes pod failures using events, logs, and resource metrics.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill k8s-debug-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: k8s-debug
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/incidentfox/local/claude_code_pack/skills/k8s-debug
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill k8s-debug-erwinv2k-tkg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging Kubernetes workloads is slow when engineers jump straight to logs without understanding why pods entered a failing state. This Skill provides a structured investigation methodology that prioritizes cluster events over logs, dramatically reducing time to root cause for common pod and deployment failures. ## Core Features & Use Cases - Event-First Investigation Flow: Enforces a golden rule of checking pod events before logs, with a defined sequence from list_pods through describe_deployment. - Pattern-Based Diagnosis: Provides decision tables and checklists for CrashLoopBackOff, OOMKilled, ImagePullBackOff, Pending pods, probe failures, evictions, and stuck rollouts. - Error Classification: Distinguishes non-retryable errors (401, 403, 404, missing config) from retryable ones (429, 5xx, timeouts) to guide remediation. - Use Case: A pod enters CrashLoopBackOff after a deployment. Follow the flow to check events, identify an OOMKilled reason, compare memory usage against limits with get_pod_resources, and confirm the fix by raising the memory limit. ## Quick Start Ask the assistant to debug why the pods in the payments namespace are stuck in CrashLoopBackOff using the k8s-debug investigation flow.

Frequently Asked Questions about k8s-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a CrashLoopBackOff pod in Kubernetes?

Start with get_pod_events to see why the container is restarting, then check get_pod_logs only if events do not explain the failure. Common causes include OOMKilled memory limits, application startup errors, and missing config or secrets.

How to fix OOMKilled pods in Kubernetes?

Confirm the OOMKilled reason via get_pod_events, then run get_pod_resources to compare actual memory usage against configured limits. Raise the memory limit, investigate memory leaks, or check for traffic spikes causing memory pressure.

Why is my Kubernetes pod stuck in Pending state?

Pending pods usually fail scheduling. Check get_pod_events for FailedScheduling due to insufficient resources, Unschedulable caused by node affinity or taints, or a nodeSelector matching no available nodes.

Should I check Kubernetes events or logs first when debugging?

Always check events first. Events explain scheduling, image pulling, probe, and OOM issues faster than logs, which only show application-level errors after the container actually starts.

What causes ImagePullBackOff errors in Kubernetes?

ImagePullBackOff typically results from a wrong image name or tag, missing imagePullSecrets for a private registry, registry rate limiting, or network issues reaching the registry. Confirm the exact cause with get_pod_events.

Which Kubernetes errors should not be retried?

Non-retryable errors include 401 Unauthorized, 403 Forbidden, 404 Not Found, and responses indicating configuration is required. Retryable errors include 429 rate limits, 5xx server errors, timeouts, and connection refusals.