Kubernetes node as unavailable and reschedule

To mark a Kubernetes node as unavailable and reschedule all the pods running on it, you can use the following steps

1. kubectl cordon Kubernetes02

2. kubectl drain Kubernetes02 --ignore-daemonsets --delete-emptydir-data

This safely evicts all the pods running on the node. It ensures that the pods are rescheduled to other available nodes, respecting the PodDisruptionBudget and other constraints.

3. kubectl get nodes

kubectl get pods -o wide

4. kubectl drain Kubernetes02 --ignore-daemonsets --delete-emptydir-data --force

--force: Removes pods not managed by a replication controller, replica set, job, or daemonset. Use this with caution, as it will forcibly evict unmanaged pods.


要查看或添加评论,请登录

Darshana Kasthuriarachchi的更多文章

  • Kubernetes, requests & limits

    Kubernetes, requests & limits

    In Kubernetes, requests and limits are configurations used to manage the CPU and memory resources allocated to…

  • Imperative VS Declarative Kubernetes

    Imperative VS Declarative Kubernetes

    ##Imperative Kubernetes In an imperative approach, you issue specific commands to Kubernetes to create, update, or…

社区洞察

其他会员也浏览了