In Kubernetes, ResourceQuota is provided to handle and enforce the quota on various objects with different criteria(values/count etc).
The API also provide different Scopes to choose/filter the objects which shall be considered for quota calculation.
|Terminating||Match pods where .spec.activeDeadlineSeconds >= 0|
|NotTerminating||Match pods where .spec.activeDeadlineSeconds is nil|
|BestEffort||Match pods that have best effort quality of service.|
|NotBestEffort||Match pods that do not have best effort quality of service.|
|PriorityClass||Match pods that references the specified priority class.|
|CrossNamespacePodAffinity||Match pods that have cross-namespace pod (anti)affinity terms.|
Source : Resource Quotas | Kubernetes
All the scopes that are supported only “PriorityClass” resembles the key-value kind of flexibility for selection/filtering of objects. Primarily I am trying to find out why k8s labels are not supported as part of the same scope ?
Reason for looking to these aspect of design is that, we are now forced to implement “PriorityClass” just to filter the pods that should be part of the Quota. (We are actually not using Priority for the pods/deployments. They are just identifiers for ResourceQuota i.e. labels)
Thanks in advance.