<p>I'm learning Kubernetes. I have a 3 node cluster, to which I have deployed nginx with 3 replicas. Therefore I have 3 replicated nginx pods.</p>

<p>I have provisioned a Load Balancer server to access these pods and exposed Port 80 - all this works fine.</p>

<p>That is, until I try to update the website. I think maybe I'm confused about how the Pods sync. </p>

<p>For example, On one of the pods I have changed the the default index.html page. I did this by connecting to the shell on one of the pods and physically changing this file. Perhaps foolishly, I expected this change to be replicated to the other pods and for this change to be visible when accessing the service via the load balancer. However, it is not. I occasionally access this changed page, but I guess that's only because the Load Balancer is doing some sort of round robin on the replicas.</p>

<p>So my questions as a newcomer to Kubernetes are, how do the replicas sync? Can you force the others to sync with another replica? Should it be automatic?</p>

<p>I should add that I have looked through the Kubernetes documentation and haven't really found the answer I'm looking for, so any help would be appreciated.</p>

<p>Also, I am running Kubernetes on GCP.</p>

Molenpad
<p>Pods are considered disposable groupings of containers. You should not modify them directly instead use a <strong>Deployment</strong></p>

<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer">Kubernetes deployments</a></p>

<p>There is a very nice interactive <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-interactive/" rel="nofollow noreferrer">tutorial</a> regarding updating.</p>

<p>The gist is.</p>

<ol>
<li>Create a new image and push this image.</li>
<li>Set the image of your deployment to this new images.</li>
</ol>

<p>This will initiate a rolling update. </p>
