<p>I am basically trying to apply pod CPU limits on my cluster. I made the edit to my deployment.yaml (added requests, limits) in there and applied the yaml. Below are the observations:</p>
<ol>
<li>I don't get any error when I apply the file (my existing app pod is terminated, a new one is spun up)</li>
<li>I can see a QoS class being applied when I do a describe on my pod (Qos: Burstable)</li>
<li>The issue is that the limits are not being honored, as I can see in my metrics server that the pod CPU &gt; 300 (whereas the limit set is 200m)</li>
<li>I have a istio sidecar container attached to the pod (but I only want to apply the limit to my app an not Istio)</li>
</ol>
<p>Snippet of yaml file:</p>
<pre><code>resources:
    limits:
        cpu: 200m
        memory: 100Mi
    requests:
        cpu: 50m
        memory: 50Mi
</code></pre>
<p>Any ideas what else I need to check here, I checked all documentation and get no errors but the limits are not being applied. Thanks in advance!</p>

Contraboy
<p>Pod CPU includes all containers in the pod, while the limits you've specified apply only to the app container.<br />
If you query metrics for the container alone, you will probably find that it's honouring the limits you've enforced upon it.<br />
Here's an example prometheus query you can use if you're running it on your cluster, that will allow you to understand the ratio between every container actual CPU usage and it's CPU requests -</p>
<pre><code>max(sum(irate(container_cpu_usage_seconds_total{container=~&quot;&lt;container_name&gt;&quot;, image !=&quot;&quot;,namespace=&quot;&lt;namespace&gt;&quot;, pod=~&quot;&lt;Deployment_name&gt;&quot;}[5m])) by (pod, namespace)) 
/ 
max(sum(kube_pod_container_resource_requests_cpu_cores{namespace=&quot;&lt;namespace&gt;&quot;, container=~&quot;&lt;container_name&gt;&quot;, pod=~&quot;&lt;deployment_name&gt;&quot;}) by (pod,namespace))
</code></pre>
