I need to queue Kubernetes resources, basing on the Kubernetes quotas.
Sample expected scenario:
- a user creates Kubernetes resource (let's say a simple X pod)
- quora object resource count reached, pod X goes to the
Pending
state - resources are released (other pod Y removed), our X pod starts creating
For, now this scenario will not work, due to the quota behavior which returns 403 FORBIDDEN
, when there are no free resources in quota:
If creating or updating a resource violates a quota constraint, the request will fail with HTTP status code 403 FORBIDDEN with a message explaining the constraint that would have been violated.
Question: Is there a way to achieve this via native Kubernetes mechanisms?
I was trying to execute pods over Kubernetes Jobs, but each job starts independently and I'm unable to control the execution order. I would like to execute them in First In First Out method.