<p>I am trying to set a deployment of containers in Kubernetes. I want the resource utilization to be controlled. I am referring <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#specify-a-memory-request-and-a-memory-limit" rel="nofollow noreferrer">this</a>.</p>

<p>An example config from the docs - </p>

<pre><code>resources:
      limits:
        memory: "200Mi"
      requests:
        memory: "100Mi"
    command: ["stress"]
    args: ["--vm", "1", "--vm-bytes", "150M", "--vm-hang", "1"]
</code></pre>

<p>But I am not able to clearly understand the differences between <code>requests</code> and <code>args</code> fields. <code>limits</code> is somewhat clear that the container should not be using more than the limit amount of resource. </p>

<p>What purpose does <code>args</code> serve exactly. <a href="https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#specify-a-memory-request-and-a-memory-limit" rel="nofollow noreferrer">Here</a>, it is stated that this is the resource the container would start with. Then how is it different from <code>requests</code> ?</p>

<pre><code>resources:
  limits:
    memory: "200Mi"
  requests:
    memory: "100Mi"
</code></pre>

<p>Resource has request and limit field.<br>
It means minimum 100Mi memory should be allocated to the container and this values is sufficient to run the container. In case of spike in traffic, it can burst memory consumption upto 200Mi. It is kind of upper bound. If it exceeds more than 200Mi the container will get killed/restarted.</p>

<p>Args are being passed to command(stress container) as command line arguments.</p>

<p><a href="http://people.seas.harvard.edu/~apw/stress/" rel="nofollow noreferrer">Stress Tool Docs</a><br>
<a href="https://hub.docker.com/r/progrium/stress/" rel="nofollow noreferrer">DockerImageForStress</a></p>

<p>looks like stress is consuming --vm-bytes=150M  memory passed as an arg</p>

<p>I think with the help of stress tool, the docs are trying to indicate the container can consume memory between request and limit values.</p>
