title: Force Kubernetes Pod shutdown before starting a new one in case of disruption
body: <p>I'm trying to set up a stateful Apache Flink application in Kubernetes and I need to save the current state in case of a disruption, such as someone deleting the pod or it being rescheduled due to cluster resizing.</p>
  
  <p>I added a preStop hook to the container that accomplishes this behaviour, but when I delete a pod using <code>kubectl delete pod</code> it spins up a new Pod before the old one terminates.</p>
  
  <p>Guides such as <a href="https://kubernetes.io/docs/tasks/run-application/run-single-instance-stateful-application/" rel="nofollow noreferrer">this one</a> use the Recreate update strategy to make sure only one pod runs at a time. This works fine in case of updating a deployment, but it does not cover disruptions like I described above. I also tried to set <code>spec.strategy.rollingUpdate.maxSurge</code> to 0 but that made no difference.</p>
  
  <p>Is it possible to configure my Deployment in such a way that no pod <em>ever</em> starts before another one is terminated, or do I need to switch to StatefulSets?</p>