# ๐ŸŒ Node Management with Kubernetes Efficient management of Kubernetes nodes ensures cluster stability and workload flexibility. Below are key commands for listing and maintaining nodes. --- ## ๐Ÿ“‹ Listing Nodes ### ๐Ÿ”น Show All Nodes ```bash kubectl get nodes ```` ### ๐Ÿ”น Show Nodes with Labels ```bash kubectl get nodes --show-labels ``` --- ## ๐Ÿ”ง Node Maintenance (Cordon / Drain) ### ๐Ÿšซ Cordon a Node Prevent new pods from being scheduled on the node. ```bash kubectl cordon ``` ### โœ… Uncordon a Node Mark the node as schedulable again. ```bash kubectl uncordon ``` ### ๐Ÿงน Drain a Node Evict all pods from the node (excluding those managed by DaemonSets). * Forcefully drain the node: ```bash kubectl drain --ignore-daemonsets --force ``` * Drain and delete local data: ```bash kubectl drain --ignore-daemonsets --delete-local-data ``` #### ๐Ÿ”„ Undo Drain (Uncordon) ```bash kubectl uncordon ``` > โš ๏ธ **Warning:** Draining a node will evict running pods. Ensure that this is planned to avoid service disruption.