kubernetes-debug

Diagnose Kubernetes pod crashes, OOMKilled events, and deployment failures via gateway-routed scripts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires kubernetes, httpx, and includes scripts (resource) components.

What problem does it solve? Debugging Kubernetes workloads normally requires direct cluster access and deep kubectl knowledge. This Skill provides a structured debugging methodology and ready-made scripts that route all queries through a k8s-gateway, so you can investigate pod crashes, CrashLoopBackOff, OOMKilled, and deployment issues on remote clusters without direct API access. ## Core Features & Use Cases - Gateway-First Cluster Discovery: Lists connected clusters via the k8s-gateway and routes every query with a --cluster-id, eliminating the need for local kubeconfig or direct API access. - Events-Before-Logs Methodology: Enforces a proven diagnostic order (events first, then logs) that resolves most issues faster, with a lookup table mapping event reasons like OOMKilled and ImagePullBackOff to concrete remediation steps. - Complete Diagnostic Toolkit: Scripts for listing pods and namespaces, fetching events and logs, describing pods, deployments, and nodes, and comparing resource usage against limits via metrics-server. - Use Case: A payment pod in production is stuck in CrashLoopBackOff. You list clusters, pull the pod's events to find an OOMKilled reason, check resource limits versus actual usage, and get a structured root-cause report with a recommended memory limit increase. ## Quick Start Ask the agent to debug why a specific pod is crashing in a given namespace, and it will discover the cluster, check events, and report the root cause.

Frequently Asked Questions about kubernetes-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 by fetching the pod's events with get_events.py, since events explain most crashes faster than logs. Then use describe_pod.py to check restart counts and container states, and only pull logs with get_logs.py if events do not reveal the cause.

How do I debug Kubernetes without direct kubectl access?

Run list_clusters.py to discover clusters connected through the k8s-gateway, then pass --cluster-id to scripts like list_pods.py, get_events.py, and get_logs.py. All queries are routed through the gateway, so no local kubeconfig or direct API access is needed.

What does OOMKilled mean and how do I fix it?

OOMKilled means the container exceeded its memory limit and was terminated by the kernel. Use get_resources.py to compare actual usage from metrics-server against configured limits, then either raise the memory limit or fix the underlying memory leak.

Why is my Kubernetes deployment not progressing?

Run describe_deployment.py to inspect desired versus ready replicas, deployment conditions, and rollout history across ReplicaSet revisions. Then list pods to find stuck replicas and check their events for scheduling or image pull failures.

Which Kubernetes debugging scripts work through the gateway?

Gateway-capable scripts are list_pods, get_events, get_logs, describe_pod, describe_deployment, and list_namespaces. The describe_node and get_resources scripts require direct cluster access and are not available in SaaS gateway mode.

What environment variables are required for gateway mode?

Gateway mode requires K8S_GATEWAY_URL to reach the gateway and INCIDENTFOX_TENANT_ID to identify the organization. Listing clusters additionally needs CONFIG_SERVICE_URL plus either TEAM_TOKEN or the INCIDENTFOX_TENANT_ID and INCIDENTFOX_TEAM_ID pair.