<p>This <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/" rel="nofollow noreferrer">page</a> provides the following example from a container resource manifest of a pod configuration file:</p>
<blockquote>
<pre><code>resources:
  limits:
    cpu: &quot;1&quot;
  requests:
    cpu: &quot;0.5&quot;
args:
- -cpus
- &quot;2&quot;
</code></pre>
</blockquote>
<p>And there are some notes describing what this means:</p>
<blockquote>
<p>The args section of the configuration file provides arguments for the
container when it starts. The -cpus &quot;2&quot; argument tells the Container
to attempt to use 2 CPUs.</p>
<p>Recall that by setting -cpu &quot;2&quot;, you configured the Container to
attempt to use 2 CPUs, but the Container is only being allowed to use
about 1 CPU. The container's CPU use is being throttled, because the
container is attempting to use more CPU resources than its limit.</p>
</blockquote>
<p>What does it mean to say that the container is being &quot;told to attempt to use 2 CPUs&quot;?</p>
<p>From the example and note, it seems to imply that the container is being told to use more resources than what the limit constrains, but why would anyone do that?</p>
<p>I was assuming that the args above indicate across how many CPUs the container can span its resource utilization, but that the aggregate utilization across all of those CPUs would have to remain within the specified limits.  But given the notes on the page, it seems to not work the way I expected, and that the args: -cpus is used for some other purpose/benefit, but I can't seem to glean what that is.</p>

David B
<p>This example is misleading. There is nothing special about the <code>-cpu 2</code> in the <code>args</code> section. The <code>args</code> section is just a way to provide paramaters to the container. The same way you would if running the container manually with <code>docker run</code>. In this example the command will end up being: <code>docker run someimage:latest -cpus 2</code>. The <code>-cpus 2</code> portion gets passed along to the entrypoint of the image and (if supported) will get used by the application running inside that container.</p>
<p>I would imagine the aim was to show that you can have an application (container) that takes in a <code>cpu</code> parameter to control how much CPU that application consumes. But still limit the container usage from a k8's level using <code>limits</code> in the pod manifest.</p>
