<p>I have a Pod - I want to update to latest version of container image, if it fails then want to revert it back to earlier version of container image.</p>
<p>Which approach of below will be good to update to latest or earlier container image.
1&gt; using kubectl patch is good option?
2&gt; deleting the pod and again creating the pod is good option?</p>
<p>what are benefits/disadvantages of both approach.</p>
<pre><code>kubectl patch pod test-pod -p '{&quot;spec&quot;:{&quot;containers&quot;:[{&quot;name&quot;:&quot;test&quot;,&quot;image&quot;:&quot;1.0&quot;}]}}'
</code></pre>
<p><code>kubectl delete pod test-pod and kubectl apply -f testpod.yaml</code></p>

Jayashree Madanala
<p>based on the scenario put up by you, you can choose to look for doing canary deployments by using the rolling update strategy, if the new deployment's containers fail to serve the load then the old ones will not be destroyed and load will continuously be served by pre-existing containers.</p>
<p>The other way can be to keep deployment history, you can define the number of manifests you want to be saved by kubernetes and then you can manually rollback to your desired version</p>
<p>And if you are not aware about what version carries which image then you can go for patch command, as portrayed by you in the question</p>
