Use when asked to check cluster health, "what's wrong in k8s", "check pods", or "/k8s-health". Runs a structured Kubernetes health check across nodes, workloads, and recent events.
التثبيت
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
Use when asked to check cluster health, "what's wrong in k8s", "check pods", or "/k8s-health". Runs a structured Kubernetes health check across nodes, workloads, and recent events.
k8s-health-check
When to use
"check cluster health" / "/k8s-health"
"what's wrong in Kubernetes?"
"why are pods crashing?"
"check the namespace "
Inputs
Optionally: namespace (default: all namespaces), cluster context, or a specific workload name.
Procedure
Confirm context. Verify the target cluster before running any commands:
kubectl config current-context
If it doesn't match the user's intent, ask before proceeding.
Cluster-level checks (run in parallel):
kubectl get nodes -o wide # node status + roles
kubectl top nodes # CPU/mem pressure
kubectl get events --all-namespaces \
--field-selector type=Warning \
--sort-by='.lastTimestamp' | tail -20 # recent warnings
Workload checks:
# Not-running pods
kubectl get pods -A --field-selector='status.phase!=Running,status.phase!=Succeeded'# Recent restarts (>3 restarts is a signal)
kubectl get pods -A --sort-by='.status.containerStatuses[0].restartCount' | tail -20
# Pending pods (scheduling issues)
kubectl get pods -A --field-selector=status.phase=Pending