Kubernetes pod resource limiting/quotas as a percentage of host resources (relative) rather than using absolute values?

340 views Asked by At

Resource limiting of containers in pods is typically achieved using something like below -

resources
  limits
    cpu "600m"
  requests
    cpu "400m"

As you see, absolute values are used above.
Now,

  1. If the server/host has, say, 1 core then the total CPU computing power of the server is 1,000m. And the container is limited to 600m of computing power, which makes sense.
  2. But, if the server/host has say 16 cores then the total CPU computing power of server is 16,000m. But the container is still restricted to 600m of computing power, which might not make complete sense in every case.

What I instead want is to define limits/requests as a percentage of host resources. Something like below.

resources
  limits
    cpu "60%"
  requests
    cpu "40%"

Is this possible in k8s either out-of-box or using any CRD's?

0

There are 0 answers