Friday, 13 December 2024

Managing Nodes and Pods in Kubernetes: Essential Commands You Should Know

 Kubernetes provides several powerful commands for managing nodes and pods effectively. Beyond cordoning and uncordoning, there are many other important operations that help maintain a healthy and efficient cluster. This post explores additional Kubernetes commands you can use to manage your cluster’s resources seamlessly.

Draining a Node

Draining is used to safely evict all workloads from a node, often as part of maintenance or scaling operations.

Command to drain a node:

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

This command evicts all pods except those managed by daemonsets or pods with emptyDir volumes if the flag --delete-emptydir-data is used.

Read more »

Labels: