<p>We are performing rolling updates for change in docker image.</p>
<p>Deployment tool(harness) runs <code>kubectl apply</code> command for every  change in docker image.</p>
<hr />
<p>Rolling updates are by default i.e., we do not need to provide below <code>strategy</code> in the YAML:</p>
<pre><code>strategy:
  type: RollingUpdate
  rollingUpdate:
    maxSurge: 1
    maxUnavailable: 1  # this will ensure zero downtime
</code></pre>
<hr />
<p>With regards to change in docker image, is it the name of docker image that decides <code>kubectl apply</code> to perform rolling update? Because the docker image we have is, tagged as <code>image-name:latest</code></p>

overexchange
<p><code>kubectl apply</code> (see <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply" rel="nofollow noreferrer">docs</a>) only looks for changes in the Kubernetes resource specifications (the YAML) and not inside Docker images. So, if you change your Docker image and publish it with the same name and tag (i.e. your Kubernetes resource YAML doesn't change), then <code>kubectl apply</code> alone won't do anything.</p>
<p>The automatic redeployment of resources when the Docker image changes is probably implemented as a feature of Harness on top of <code>kubectl apply</code>.</p>
