<p>I want to ignore the resource request that is defined in the service manifest:</p>
<pre><code>resources:
  requests:
    memory: &quot;512Mi&quot;
    cpu: &quot;500m&quot;
  limits:
    memory: &quot;1024Mi&quot;
    cpu: &quot;1000m&quot;
</code></pre>
<p>because sometimes developers specifies requests more than they need, and it causes other services to not have enough resources.</p>
<p>I read about Resource Quotas, which I need to define at the namespace level.</p>
<p>My question is: If I define Resource Quotas in the namespace, will the resource request at the service be considered? ignored? or anything else?</p>
<p>Thanks.</p>

jrz
<p>What you can use here is a <code>ResourceQuota</code> something like:</p>
<pre><code>apiVersion: v1
kind: ResourceQuota
metadata:
  name: mem-cpu
spec:
  hard:
    cpu: &quot;100m&quot;
    memory: &quot;100Mi&quot;
    requests.cpu: &quot;500m&quot;
    requests.memory: &quot;512Mi&quot;
    limits.cpu: &quot;1&quot;
    limits.memory: 1Gi
</code></pre>
<p>So if you have defined the resource quota (the value which cannot be exceeded by sum of cpu &amp; memory requests respectively) in a namespace to 500m cpu &amp; 512Mi of memory and you worry a single pod might take it up all, you can also define <code>cpu</code> &amp; <code>memory</code> resources in the <code>ResourceQuota</code> (as you see in the example above).</p>
<p>A pod with resource requests:</p>
<pre><code>resources:
  limits:
    memory: &quot;512Mi&quot;
    cpu: &quot;500m&quot;
  requests:
    memory: &quot;200Mi&quot;
    cpu: &quot;200m&quot;
</code></pre>
<p>will result in an error:</p>
<pre><code>Error from server (Forbidden): error when creating &quot;so2.yaml&quot;: pods &quot;quota-mem-cpu-demo&quot; is forbidden: exceeded quota: mem-cpu, requested: cpu=200m,memory=200Mi, used: cpu=0,memory=0, limited: cpu=100m,memory=100Mi
</code></pre>
<p>While this would work:</p>
<pre><code>resources:
  limits:
    memory: &quot;512Mi&quot;
    cpu: &quot;500m&quot;
  requests:
    memory: &quot;100Mi&quot;
    cpu: &quot;100m&quot;
</code></pre>
<p>So you can control what resources a user requests.</p>
