djuarezg
djuarezg

Reputation: 2541

How to limit the maximum number of running pods

We currently have around 20 jobs. These jobs create one pod each, but we want to make sure that only one of these pods can run at a time, keeping the rest of them in pending status. Increasing the resource limitations makes them to run one by one but I want to be sure that this is always the behaviour.

Is there any way of limiting this concurrency to 1, let's say per label or something similar?

Upvotes: 1

Views: 917

Answers (1)

Nicola Ben
Nicola Ben

Reputation: 11327

Use ResourceQuota resource:

apiVersion: v1
kind: ResourceQuota
metadata:
  name: pod-demo
spec:
  hard:
    pods: "5"

Upvotes: 1

Related Questions