Move Kubernetes statefulset pod to another node Move Kubernetes statefulset pod to another node kubernetes kubernetes

Move Kubernetes statefulset pod to another node


It's not recommended to delete pods of a statefulset. You can scale-down the statefulset to 2 replicas and then scale it up to 3.

kubectl get statefulsets <stateful-set-name>kubectl scale statefulsets <stateful-set-name> --replicas=<new-replicas>


You will need affinity

And restart all statefulsets

kubectl rollout restart statefulset <stateful-set-name>


You can force a pod to be started on a different node by cordoning the node that the pod is running on and then redeploying the pod. That way kubernetes has to place it onto a different node. You can uncordon the node afterwards.