<p>Is it possible to use kubernetes namespace quota excluding certain resources. For example, exclude used pod resources belonging to daemonsets. Counting daemosets resources imposes an inconvenience when scaling a cluster, having to change the requestQuota resource for a large number of namespaces</p>
<p><strong>TL;DR</strong><br />
tnx <a href="https://stackoverflow.com/users/2385808/fritz-duchardt">Fritz Duchardt</a>, for the answer.</p>
<ol>
<li>Create PriorityClass.name: daemonsets</li>
<li>Add spec.template.spec.PriorityClassName: daemonsets in ds manifest</li>
<li>Create resourceQuota</li>
</ol>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: ResourceQuota
metadata:
spec:
  hard:
    requests.cpu: &quot;1&quot;
    requests.memory: 2Gi
  scopeSelector:
    matchExpressions:
    - operator: NotIn
      scopeName: PriorityClass
      values:
      - daemonsets
</code></pre>

Anatoly Kudryashov
<p>Limiting resource quotas to explicit K8s resources is not possible, but you could use <a href="https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#pod-priority" rel="nofollow noreferrer">Priority Classes</a> in conjunction with <code>scopeSelectors</code> to achieve a similar thing. More on the topic can be found <a href="https://kubernetes.io/docs/concepts/policy/resource-quotas/#resource-quota-per-priorityclass" rel="nofollow noreferrer">here</a>.</p>
