Closed akucharska closed 2 months ago
Having 2 Resource Quotas:
apiVersion: v1
kind: ResourceQuota
metadata:
name: pods-high
spec:
hard:
cpu: "1000"
memory: 2Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["high"]
apiVersion: v1
kind: ResourceQuota
metadata:
name: pods-low
spec:
hard:
cpu: "1000"
memory: 2Gi
pods: "10"
scopeSelector:
matchExpressions:
- operator : In
scopeName: PriorityClass
values: ["low"]
and applying such pod:
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: test-container
name: test-container
spec:
priorityClassName: low
containers:
- name: test-container
image: nginx
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 500m
memory: 1Gi
Will trigger only one quota:
→ kubectl get quota
NAME AGE REQUEST LIMIT
pods-high-burstable 21s cpu: 0/1k, memory: 0/2Gi, pods: 0/10
pods-low-burstable 38s cpu: 100m/1k, memory: 100Mi/2Gi, pods: 1/10
It doesn't make sense to get mnimum value from resource quota.
The same situation applies to sum of resources: https://stackoverflow.com/questions/69127848/what-happens-if-more-than-one-resourcequota-is-enabled-per-namespace.
We could try to group quotas by selectors and find the lowest values within the same group.
Closed in favor: https://github.com/kyma-project/busola/issues/2992
If there is more than one resource quota on a namespace then the lower value should be used in graphs