Namespace PodNodeSelector no effect on existing running pods/statefulsets Namespace PodNodeSelector no effect on existing running pods/statefulsets kubernetes kubernetes

Namespace PodNodeSelector no effect on existing running pods/statefulsets


You cannot. This is how it works at the moment. Once a pod is scheduled on a node it stays on a node.

Same applies to affinity/antiaffinity.

But in k8s docs you can read:

In the future we plan to offerrequiredDuringSchedulingRequiredDuringExecution which will be justlike requiredDuringSchedulingIgnoredDuringExecution except that itwill evict pods from nodes that cease to satisfy the pods' nodeaffinity requirements.

And this is what you are looking for, but it is not implemented yet.It looks like deleting pods to force then to reschedule is the only option available at the moment.