# KubeDoctor

> AI-powered Kubernetes diagnostic assistant for root-cause analysis of pods, services, and cluster health.

KubeDoctor is a free AI agent skill on Agensi by Rahul Dan, in DevOps & Cloud. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Rahul Dan](https://www.agensi.io/creators/rahul-dan)
- Category: [DevOps & Cloud](https://www.agensi.io/skills/devops-cloud)
- Version: 1.0
- Last updated: 2026-11-22
- Security: scan passed (2026-11-22); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/kubedoctor
- Tags: ai-agents, kubernetes, devops, sre, mcp

## About this skill

Debugging Kubernetes workloads manually involves jumping between `kubectl get`, `describe`, `logs`, and `events`, often losing track of the correlation between pod states and container exit codes. This skill provides an automated diagnostic layer that inspects live cluster state to deliver evidence-based root-cause analysis for failing resources.

### What it does
- **Cluster Triage** scans nodes for readiness, memory pressure, and disk pressure across the entire environment.
- **Deep Pod Diagnostics** correlates container lifecycle phases, exit codes, and recent log streams into a single health report.
- **Error Detection** automatically identifies pods stuck in `CrashLoopBackOff`, `ImagePullBackOff`, or `Pending` states.
- **Network Validation** inspects Service selectors, endpoint readiness, and Ingress routing rules to find connectivity gaps.
- **Resource Correlation** matches Kubernetes events to specific workload failures to find underlying scheduling or auth issues.

### How it works
1. Run `cluster_health` or `namespace_health_scan` to locate problematic resources in the environment.
2. Invoke `doctor` on specific pods to retrieve a combined view of logs, events, and container exit states.
3. Use specialized detection tools like `detect_crashloops` or `detect_pending_pods` to filter for specific failure patterns.
4. Call `diagnose_service` or `diagnose_ingress` to verify the networking path from the gateway to the pod labels.

### Frameworks & tools
Built for Kubernetes environments using the Model Context Protocol. Works with standard `kubectl` logic to interface with clusters, deployments, services, and ingress controllers.

### Why this beats prompting it yourself
Generic prompts struggle to systematically link a container's `exit code 137` to node memory pressure or a `Pending` pod to untolerated taints. This skill enforces a structured diagnostic workflow that ensures logs, events, and lifecycle data are correlated before offering a recommendation.

### Use cases
- Debugging why a production deployment is stuck in a restart loop after a new image rollout.
- Investigating why a Service has zero ready endpoints despite pods appearing to be running.
- Auditing namespace health to find pods failing due to missing `imagePullSecrets` or registry auth.
- Identifying resource exhaustion by checking node pressure conditions and scheduling constraints.

### Known limitations
This skill performs read-only operations and cannot delete pods, scale deployments, or edit YAML manifests. It requires an active Kubernetes context with sufficient RBAC permissions to list and describe resources.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the KubeDoctor skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How is KubeDoctor different from simply asking an AI to look at my kubectl logs?

KubeDoctor automates the manual 'kubectl' workflow by correlating disparate data points—like exit codes, node pressure, and event logs—into a single root-cause report, which is much faster than manual troubleshooting.

### Which AI agents and frameworks are compatible with KubeDoctor?

The skill is designed for any AI agent or platform that supports the Model Context Protocol (MCP) and has access to a standard Kubernetes environment.

### Does KubeDoctor have the permission to make changes or deletions in my cluster?

KubeDoctor operates on a read-only basis; it can scan, describe, and analyze your cluster resources, but it cannot delete, modify, or scale your workloads.

### What are the technical requirements for setting up KubeDoctor?

You will need an active Kubernetes context (kubeconfig) and RBAC permissions that allow for listing and describing pods, services, nodes, and events across the namespaces you wish to audit.

### Can this skill help me identify networking issues like service-to-pod connectivity gaps?

Yes, it includes specialized tools like 'diagnose_service' and 'diagnose_ingress' specifically designed to find mismatches between selectors, endpoints, and routing rules.

### What specific types of Kubernetes errors is this skill best at detecting?

KubeDoctor is highly effective at identifying infrastructure-level failures like 'ImagePullBackOff', 'CrashLoopBackOff', and node-level resource exhaustion that prevents pods from scheduling.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
