kubernetes: Exceeded quota for pod priority class
What happened: Quota was exceeded for a pod priority class.
What you expected to happen: Quota is enforced for a pod priority class.
How to reproduce it (as minimally and precisely as possible):
- Create a PriorityClass.
- Create a pod using the PriorityClass created in step 1 and wait for it to be Running.
- Create a ResourceQuota with a hard limit of 2 pods for the PriorityClass created in step 1.
- Create a pod using the PriorityClass created in step 1 and wait for it to be Running.
- Create one final pod using the PriorityClass created in step 1. This should fail and it normally does. However, there appears to be a timing issue that sometimes allows the pod to be created.
Anything else we need to know?: No.
Environment:
- Kubernetes version (use
kubectl version
): 1.12.5 - Cloud provider or hardware configuration: IBM Cloud Kubernetes Service
- OS (e.g. from /etc/os-release):
Ubuntu 16.04.5 LTS
- Kernel (e.g.
uname -a
):Linux 4.4.0-141-generic
- Install tools: Installed via managed service
- Others: N/A
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 67 (33 by maintainers)
I am able to reproduce this on a 1.21.alpha cluster, and it definitely seems to be a timing issue / race condition.
Below is my all-in-one script to reproduce it, and an excerpt of the output to follow. It took about 15 minutes for the problem to occur.
An excerpt of this script’s output when it happened:
The quota knows it has more pods than allowed:
All 3 pods are running:
All 3 pods have the priority class:
My version:
@brianpursley I was finally able to recreate the problem as well but it took much longer for me.
Recreate on 1.20:
Recreate on 1.18:
we took a look to this one, will wait until next triage to see if the author could reproduce it again as suggested.