how to explicitly remove cpu limits for a container?

4/16/2019

I want to remove cpu limits for a specific container where the namespace has default cpu limits (via limitrange). Per docs the default value will be assigned. When I explicitly set limits.cpu to 0, I got an error that tells me requests value 20m should be less than or equal to limits value.

So is it possible to force no limits in that case?

-- Yasser Rabee
google-kubernetes-engine
kubernetes

2 Answers

4/16/2019

If you set the CPU limits to 0, then you will be getting <= 0 CPU resources. As per the link to the docs you have originally included, you should just set the request and not set the limit at all. That will set inform the scheduler of the pod's resource request. If your namespace has a CPU limit set, then the limit will be defaulted to that if it's not explicitly stated; otherwise, there will be no limit set.

-- Frank Yucheng Gu
Source: StackOverflow

4/18/2019

After more research, it is not possible to achieve. It does make sense to me it is not possible as stated by Frank Gu: because that would pretty much defeat the purpose of resource quotas in the first place

-- Yasser Rabee
Source: StackOverflow