Cluster Health Checks
Intermediate10 min
Run comprehensive health checks on your Kubernetes cluster to verify node status, component health, and system pod readiness.
Prerequisites
- -kubectl configured
Steps
1
Check node status
Verify all nodes are in Ready state.
$ kubectl get nodes -o wide
2
Check component status
Verify core Kubernetes components are healthy.
$ kubectl get componentstatuses 2>/dev/null; kubectl get pods -n kube-system
componentstatuses is deprecated in newer versions. Check kube-system pods instead.
3
Check for pods in error states
Find pods that are not running correctly across all namespaces.
$ kubectl get pods --all-namespaces --field-selector=status.phase!=Running,status.phase!=Succeeded
4
Check node conditions and pressure
Look for nodes experiencing memory, disk, or PID pressure.
$ kubectl get nodes -o json | jq -r '.items[] | .metadata.name + ": " + ([.status.conditions[] | select(.status=="True") | .type] | join(", "))'
5
Verify DNS is working
Test that cluster DNS resolves service names correctly.
$ kubectl run dns-test --rm -it --restart=Never --image=busybox -- nslookup kubernetes.default
Full Script
FAQ
Discussion
Loading comments...