<p>I had a quick question about rolling deploys. I'm trying to make sure that the app pods creation is staggered. I looked at <code>maxSurge</code> and <code>maxUnavailable</code> which seems to be the only settings for controlling rolling deploys. Both these settings talk about pod creation in terms of old replicaset. I want to make sure that pod creation is staggered even when there is no deployment currently running.</p>

<p>example: If I set <code>maxSurge</code> to 1 and I have the replication set to 5 then in the presence of old deployment, the rolling update strategy will do the right thing and get one pod up at a time, but if there is no old deployment, all the 5 pods will come up together on a new deployment which is something I am trying to avoid.</p>

streetsoldier
<p>What you have explaied is the ecpected behaviour in case there are no existing deployments.
So you want to do a ordered deployment - one pod after the other.</p>

<p>Try deploying the application as a statefulset.
<a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/</a></p>

<p>Also note the differences b/w a deployment and a statefulset, for example no rollback in case of statefulset
<a href="https://blog.thecodeteam.com/2017/08/16/technical-dive-statefulsets-deployments-kubernetes/" rel="nofollow noreferrer">https://blog.thecodeteam.com/2017/08/16/technical-dive-statefulsets-deployments-kubernetes/</a></p>
