mcpField
K
kubernetes-health

kubernetes-health

github.com/nodnarbnitramCloud & DevOps1684 installsUpdated 27w ago
Repository

About kubernetes-health

kubernetes-health is a discovery-driven skill for diagnosing Kubernetes cluster health. It uses the existing kubectl configuration, detects installed APIs and operators, and dispatches relevant health agents while keeping checks read-only.

Key features

  1. 01Discover API groups and installed operators
  2. 02Run core and operator health checks
  3. 03Dispatch specialized agents in parallel
  4. 04Aggregate results with health scores
  5. 05Generate a unified JSON report

Use cases

  1. 01Check cluster health after deployment
  2. 02Find health issues in clusters with varied operators
  3. 03Review cluster status without modifying resources

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/nodnarbnitram/claude-code-extensions --skill kubernetes-health

After installing, type/kubernetes-healthin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

README.md
references/
health-scoring.md
operator-checks.md
scripts/
aggregate_report.py
discover_apis.py
health_orchestrator.py
templates/
health-report.json

Details

From the project README

Kubernetes Health Diagnostics

Dynamic, discovery-driven health checks for any Kubernetes cluster configuration

BEFORE YOU START

ImpactValue
Token Savings~70% vs manual kubectl exploration
Setup Time0 min (uses existing kubectl config)
CoverageAdapts to installed operators automatically
Known Issues Prevented
ProblemRoot CauseHow This Skill Helps
Missing operator healthStatic checklists miss CRDsDynamic API discovery detects all installed operators
Stale diagnosticsManual checks become outdatedReal-time cluster API interrogation
Incomplete coverageUnknown cluster configurationAutomatically activates relevant sub-agents

Quick Start

  1. Verify cluster access: Ensure kubectl is configured and can reach your cluster
  2. Run discovery: Execute discover_apis.py to detect installed operators
  3. Dispatch agents: Use the orchestrator to run health checks based on discovery
# Step 1: Verify kubectl context
kubectl config current-context
kubectl cluster-info

# Step 2: Run API discovery
uv run .claude/skills/kubernetes-health/scripts/discover_apis.py

# Step 3: Review detected operators and dispatch health agents

Critical Rules

Always
  • Verify kubectl context before running health checks
  • Use read-only kubectl commands (get, describe, logs)
  • Run core health checks before operator-specific checks
  • Aggregate results using the provided scoring methodology
Never
  • Modify cluster resources during health checks
  • Expose secret values in health reports (metadata only)
  • Skip context verification for production clusters
  • Assume operator presence without API discovery
Common Mistakes
MistakeWhy It's WrongCorrect Approach
Hardcoding operator checksMisses installed operators, checks missing onesUse API discovery to detect what's installed
Sequential agent dispatchSlow for multi-operator clustersRun operator agents in parallel (same priority)
Raw kubectl outputToken inefficient, hard to parseUse scripts for condensed JSON output

Bundled Resources

Scripts
ScriptPurpose
scripts/discover_apis.pyDiscovers all API groups and detects installed operators
scripts/health_orchestrator.pyMaps discovered APIs to specialized health agents
scripts/aggregate_report.pyAggregates multi-agent results into unified report
References
FileContents
references/operator-checks.mdDetailed health checks for each supported operator
references/health-scoring.mdScoring methodology and weight assignments
Templates
FilePurpose
templates/health-report.jsonJSON schema for health report output

Dependencies

Required
PackageVersionPurpose
kubectlLatestCluster interaction
Python>= 3.11Script execution
uvLatestPython script runner
Optional
PackageVersionPurpose
kubernetes>= 28.1.0Python client (for advanced discovery)

Supported Operators

The skill automatically detects and dispatches specialized agents for:

OperatorAPI GroupAgent
Core K8s(always)k8s-core-health-agent
Crossplanecrossplane.iok8s-crossplane-health-agent
ArgoCDargoproj.iok8s-argocd-health-agent
Cert-Managercert-manager.iok8s-certmanager-health-agent
Prometheusmonitoring.coreos.comk8s-prometheus-health-agent

Health Scoring

StatusScore RangeCriteria
HEALTHY90-100All checks pass, no warnings
DEGRADED60-89Some warnings, no critical issues
CRITICAL0-59Critical issues affecting availability

Troubleshooting

kubectl connection issues
# Verify context
kubectl config current-context

# Test connectivity
kubectl cluster-info

# Check permissions
kubectl auth can-i get pods --all-namespaces
Discovery returns empty results
  • Ensure cluster is reachable
  • Check RBAC permissions for API discovery
  • Verify kubectl version compatibility
Agent dispatch failures
  • Confirm discovered API group matches agent trigger
  • Check agent file exists in .claude/agents/specialized/kubernetes/
  • Review agent tool restrictions

Setup Checklist

  • kubectl configured and connected to cluster
  • Python 3.11+ installed
  • uv installed for script execution
  • Read permissions on cluster resources
  • Agent files present in .claude/agents/specialized/kubernetes/

Comments

Markdown supported