<p>Trying to update the resources of my Deployment using <code>kubectl patch</code> command:</p>
<pre><code>kubectl patch statefulset test -n test --patch '{&quot;spec&quot;: {&quot;template&quot;: {&quot;spec&quot;: {&quot;containers&quot;: [{&quot;resources&quot;: [{&quot;limits&quot;: [{&quot;cpu&quot;: &quot;4000m&quot;,&quot;memory&quot;: &quot;16Gi&quot;}]},{&quot;requests&quot;: [{&quot;cpu&quot;: &quot;3000m&quot;,&quot;memory&quot;: &quot;13Gi&quot;}]}]}]}}}}'
</code></pre>
<p>But getting the below error:</p>
<blockquote>
<p><strong>Error from server: map: map[resources:[map[limits:[map[cpu:4000m memory:16Gi]]] map[requests:[map[cpu:3000m memory:13Gi]]]]] does not contain declared merge key: name</strong></p>
</blockquote>

<p>It needs to know which container you want to patch in the statefulset. You indicate this by including the name of the container.</p>
<p>Also, the json structure of your resources field is incorrect. See the example below for a complete working example:</p>
<p>(replace <strong>???</strong> with the name of the container you want patched)</p>
<pre><code>kubectl patch statefulset test -n test --patch '{&quot;spec&quot;: {&quot;template&quot;: {&quot;spec&quot;: {&quot;containers&quot;: [{&quot;name&quot;: &quot;???&quot;, &quot;resources&quot;: {&quot;limits&quot;: {&quot;cpu&quot;: &quot;4000m&quot;,&quot;memory&quot;: &quot;16Gi&quot;},&quot;requests&quot;: {&quot;cpu&quot;: &quot;3000m&quot;,&quot;memory&quot;: &quot;13Gi&quot;}}}]}}}}'
</code></pre>
