<p>With default settings, a deployment consisting of <code>n</code> replicas of a service will follow the below order during deploy:</p>
<p>Start pod <code>1</code> -&gt; Wait for pod <code>1</code> to be ready <br>
Once pod <code>1</code> is ready, start pod <code>2</code> -&gt; Wait for pod <code>2</code> to be ready <br>
...<br>
Once pod <code>n-1</code> is ready, start pod <code>n</code> -&gt; Wait for pod <code>n</code> to be ready</p>
<p>In my application, it takes several minutes before the service can accept traffic (is ready). Hence I would like to configure my deployment to follow: <br>
Start pod <code>1</code> -&gt; Start pod <code>2</code> ... -&gt; Start pod <code>n</code> <br>
Once all pods are started, wait for pods <code>1</code> to <code>n</code> to become ready.</p>
<pre><code>    ---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-webservice
spec:
  replicas: n
  selector:
    matchLabels:
      app.kubernetes.io/name: my-webservice
  template:
    metadata:
      labels:
        app: my-webservice
        app.kubernetes.io/name: my-webservice
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
      - name: my-webservice
        image: &quot;my.docker.repo/my-webservice:latest&quot;
        ports:
        - containerPort: 5000
        readinessProbe:
          httpGet:
            path: /ready
            port: 5000
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 5
          failureThreshold: 360
</code></pre>
<p>How can I configure this?</p>

Damian
<p>You may try to add <em>.spec.strategy.rollingUpdate.maxSurge</em> field in your deployment.yml (Check <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#max-surge" rel="nofollow noreferrer">here</a>)</p>
<p>I think what you need is to set <em>maxSurge: n</em></p>
<p>In your example:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-webservice
spec:
  replicas: n
  strategy:
    rollingUpdate:
      maxSurge: n
  selector:
    matchLabels:
      app.kubernetes.io/name: my-webservice
  template:
    metadata:
      labels:
        app: my-webservice
        app.kubernetes.io/name: my-webservice
    spec:
      securityContext:
        runAsNonRoot: true
      containers:
      - name: my-webservice
        image: &quot;my.docker.repo/my-webservice:latest&quot;
        ports:
        - containerPort: 5000
        readinessProbe:
          httpGet:
            path: /ready
            port: 5000
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 5
          failureThreshold: 360
</code></pre>
<p>Thus, when you apply an update, n new pods will be created simultaneously.</p>
