Command
kubectl get nodesExplanation
The 'kubectl get nodes' command lists all nodes participating in the Kubernetes cluster, showing their names, statuses, roles, and resource versions. The output helps cluster administrators monitor the state of nodes, determine readiness, and ensure proper node registration. With '-o wide', you can view IP addresses, OS details, and Kubernetes versions.
Common Use Cases
- •Monitor node health and readiness
- •Verify cluster scaling after adding new nodes
- •Check node roles and Kubernetes versions
Best Practices
- ✓Regularly check node readiness before scheduling workloads
- ✓Use JSON or YAML output formats for automation or scripting
Common Mistakes to Avoid
- ⚠Assuming 'Ready' means all pods are healthy — it only indicates node availability
- ⚠Forgetting '-o wide' for additional insights like internal IPs and versions
Troubleshooting
Problem: A node shows 'NotReady' status
Solution: Run 'kubectl describe node <name>' to inspect conditions and kubelet logs for failures.
Examples
List all nodes in the cluster
kubectl get nodesList nodes with detailed info like IP and OS
kubectl get nodes -o wide