I have a running pod (pod-1), deployed from a k8s deployment (deploy-1), on k8s node-1. Someday, I want to patch node affinity to this deployment. For example, the target node must have label 'data=allowed'.
My steps:
- Add label 'data=allowed' to node-1 first
- Patch the node affinity definition to deploy-1
My expectation is that the pod-1 should not be rescheduled by k8s, since it is already on node-1, which is already meet the node affinity rule(Step 1). But the result is that pod-1 was recreated, although still on node-1.
Is there any configuration to prevent the recreation if the living pod/deployment has meet the new defined node affinity rule? Thanks.