Search code examples
kubernetes

How to move a pod from one node to another in kubernetes


I have a pod P1 that located in Node N1. I need to move that to another Node N2. What are the different ways to do this other than node selector?

nodeSelector: name: N1


Solution

  • First of all you cannot “move” a pod from one node to another. You can only delete it from one node and have it re-created on another. To delete use the kubectl delete command. To ensure a pod lands on a specific node using node affinity/taints and tolerations. Hope that helps.

    please see this Answer