<p>We have 3 namespaces on a kubernetes cluster</p>

<pre><code>dev-test / build / prod
</code></pre>

<p>I want to limit the resource usage for <code>dev-test</code> &amp; <code>build</code> only. 
Can I set the resource quotas only for these namespaces without specifying (default-) resource requests &amp; limits on the pod/container level?</p>

<p>If the resource usage on the limited namespaces is low, prod can use the rest completely, and it can grow only to a limited value, so prod resource usage is protected. </p>

<pre><code>apiVersion: v1
kind: ResourceQuota
metadata:
  name: dev-test
spec:
  hard:
    cpu: "2"
    memory: 8Gi
</code></pre>

<p>Is this enough?</p>

Alexej Medvedev
<p>Yes, you can set resource limits per namespace using ResourceQuota object:</p>

<pre><code>apiVersion: v1
kind: ResourceQuota
metadata:
  name: mem-cpu-demo
spec:
  hard:
    requests.cpu: "1"
    requests.memory: 1Gi
    limits.cpu: "2"
    limits.memory: 2Gi
</code></pre>

<p>From <a href="https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/" rel="nofollow noreferrer">kubernetes documentation</a>.</p>
