<p>I created a ReplicationController using the below command.</p>

<blockquote>
  <p>kubectl run nginx --image=nginx -r=2 --generator=run/v1</p>
</blockquote>

<p>Now I tried upgrading the image to version 1.7.1.</p>

<blockquote>
  <p>kubectl set image rc/nginx nginx=nginx:1.7.1</p>
</blockquote>

<p>But, the image doesn't seem to update.</p>

<blockquote>
  <p>watch -n1 "kubectl describe pods | grep "Image:""</p>
</blockquote>

<p>Also tried <code>kubectl edit ....</code> and the <code>kubectl apply -f ....</code> command, but the image is not getting updated.</p>

<p>How do I update an image in K8S ReplicationController?</p>

Praveen Sripati
<p>Here in documentation is described how to make rolling upgrade on replication controllers <a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#rolling-updates" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/#rolling-updates</a> </p>

<p>You need to know that actually your image is updated in replication controller but replication controller won't kill existing pods and spawn new with new image. So to achieve that you need to do one of 2 options:</p>

<ol>
<li>Manually kill pods</li>
<li>Scale your RC to 0 to kill pods and then to desired number of replicas using following command <code>kubectl scale --replicas=3 rc/nginx</code></li>
</ol>
