Hi everyone, I have a question with the Lab Exercise Node Affinity. When I edit . . .

Raphael Fakhir:
Hi everyone, I have a question with the Lab Exercise Node Affinity.
When I edit the deployment to incorporate the following Node Affinity:

root@controlplane:~# kubectl edit deployments blue

affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: color
operator: In
values:
- blue

Why does it terminate and redeploy the pods?
I thought IgnoredDuringExecution would leave the pods as is, until I manually delete them, then they would get rescheduled on the designated node.

Viraj Attanayake:
I think “Ignore During Execution” is for existing pods in nodes without changes. Once you have changed it, it will get rescheduled

Raphael Fakhir:
Ah right makes sense, I changed the deployment with edit which changes the pods and redeploys them.
Thanks : )