<p>Need to understand exactly how patch works. How could I patch "imagePullPolicy" for instance. Could someone explain in simple details how patch works.</p>

<pre><code>kubectl patch statefulset my-set -p '{"spec":{"containers":{"imagePullPolicy":"IfNotPresent"}}}'
</code></pre>

<p>This is not working what is wrong with it?</p>

Janis Karklins
<p>In addition to @Colwins answer, you should also add mandatory key <strong>name</strong> into container spec, otherwise you'll get <code>does not contain declared merge key: name</code></p>

<p>So, you kubectl command should look like:</p>

<pre><code>kubectl patch statefulset my-set -p '{"spec": {"template": {"spec":{"containers":[{"name":"nginx","imagePullPolicy":"Never"}]}}}}'
</code></pre>
