Files
my-docs/Containerization & Orchestration/Kubernetes/node-manage.md
2025-06-24 20:47:06 +03:30

729 B

Node Management

Listing Nodes

  • Show All Nodes

    kubectl get nodes
    
      kubectl get nodes --show-lables
    

Node Maintenance (Cordon/Drain)

  • Cordon a Node
    Prevent new pods from being scheduled on the node.

    kubectl cordon <node-name>
    
  • Uncordon a Node
    Mark the node as schedulable again.

    kubectl uncordon <node-name>
    
  • Drain a Node
    Evict all pods from the node (excluding those managed by DaemonSets).

    kubectl drain <node-name> --ignore-daemonsets --delete-local-data
    

    Warning: Draining a node will evict running pods. Ensure that you plan this action to avoid service disruption.