<p>I am attempting to do a rolling update of a deployment and I am still getting about 2 seconds of downtime.   Did I misconfigure my yaml?   I am also using ambassador as the API gateway and not entirely sure whether the issue is in the API Gateway or in the deployment.</p>

<p>I wrote a simple shell script that runs a curl every second and I always have about 2 seconds of downtime with this config.  Any help is much appreciated.</p>

<p>Here is my relevant config.</p>

<p>deployment Method:</p>

<pre><code>kubectl apply -f MY_DEPLOYMENT.yaml
</code></pre>

<p>Deployment Snippet:</p>

<pre><code>apiVersion: apps/v1 
kind: Deployment
metadata:
  name: web-service-rf
spec:
  selector:
    matchLabels:
      app: web-service-rf
  replicas: 2 # tells deployment to run 2 pods matching the template
  strategy:
    rollingUpdate:
      maxSurge: 4
      maxUnavailable: 0%
</code></pre>

<p>Liveness and Readiness Probe:</p>

<pre><code>  livenessProbe:
    httpGet:
      path: /health/liveness
      port: 80
    initialDelaySeconds: 5
    periodSeconds: 3
  readinessProbe:
    httpGet:
      path: /health/readiness
      port: 80
    initialDelaySeconds: 5
    periodSeconds: 5
    successThreshold: 1 
</code></pre>

mornindew
<p>you're YAML seems fine, I suspect the 2 second down time may be due to a TCP connection that did not flush properly to the pod that is being replaced.</p>

<p>Can you add a prestop hook to your container to make sure that all TCP connections are drained before terminating the pod?</p>
