When dealing with multiple resourcequotas in the same namespace, we decide to skip the ones which have Scope defined and the scope contains Terminating.
1.Define 2 resourcequotas in a namespace, one of them has the Terminating scope
[root@api.ocp410kev.cp.fyre.ibm.com ~]# k get resourcequotas
NAME AGE REQUEST LIMIT
quotatest-single-container2 269d limits.cpu: 30m/330m, limits.memory: 300Mi/330Mi
quotatest-small 16m limits.cpu: 0/10m, limits.memory: 0/10Mi
[root@api.ocp410kev.cp.fyre.ibm.com ~]# k describe resourcequotas quotatest-small
Name: quotatest-small
Namespace: quotatest-single-container2
Scopes: NotBestEffort, Terminating <--------------here
* Matches all pods that have at least one resource requirement set. These pods have a burstable or guaranteed quality of service.
* Matches all pods that have an active deadline. These pods have a limited lifespan on a node before being actively terminated by the system.
Resource Used Hard
-------- ---- ----
limits.cpu 0 10m
limits.memory 0 10Mi
2.Create a deployment and rediscover+broadcast, and check the Kubeturbo log
k logs -f kubeturbo-kw-114-869856f484-tjs7r |grep resourcequota
I0908 20:02:30.654860 1 kube_cluster.go:539] Found a resourcequota quotatest-small in the namespace quotatest-single-container2 with the scopes([Terminating NotBestEffort]) or scopeSelector(nil)
I0908 20:02:30.654870 1 kube_cluster.go:548] Ignore the resourcequota quotatest-small in the namespace quotatest-single-container2 as it has a Terminating scope
3.Check the Capacity and Usage on the UI for that namespace
The capacity doesn't pick up the smaller one defined in the quotatest-small resourcequota
Checklist
These are the items that must be done by the developer and by reviewers before the change is ready to merge. Please strikeout any items that are not applicable, but don't delete them
[ ] Developer Checks
[x] Full build with unit tests and fmt and vet checks
[ ] Unit tests added / updated
[ ] No unlicensed images, no third-party code (such as from StackOverflow)
[ ] Integration tests added / updated
[x] Manual testing done (and described)
[ ] Product sweep run and passed
[ ] Developer wiki updated (and linked to this description)
[ ] Reviewer Checks
[ ] Merge request description clear and understandable
[ ] Developer checklist items complete
[ ] Functional code review (how is the code written)
[ ] Architectural review (does the code try to do the right thing, in the right way)
Intent
When dealing with multiple resourcequotas in the same namespace, we decide to skip the ones which have Scope defined and the scope contains
Terminating
.Background
https://jsw.ibm.com/browse/TRB-46978
Testing
1.Define 2 resourcequotas in a namespace, one of them has the
Terminating
scope2.Create a deployment and rediscover+broadcast, and check the Kubeturbo log
3.Check the
Capacity and Usage
on the UI for that namespace The capacity doesn't pick up the smaller one defined in thequotatest-small
resourcequotaChecklist
These are the items that must be done by the developer and by reviewers before the change is ready to merge. Please
strikeoutany items that are not applicable, but don't delete themAudience
(@ mention any
review/...
groups or people that should be aware of this merge request)