Determining reasonable values for quotas and limit ranges

11/6/2018

What approach do you take in order to identify feasible values for resource requests and limits for ResourceQuota and LimitRange objects in OpenShift/Kubernetes projects?

I am not asking how to create quotas or limit ranges, but rather how to rationalize cpu/memory request/limit values instead of simply guessing.

I have come across this blog post which is a good starting point, and was hoping to find more resources or recommendations for best practices. I understand that I will have to tinker with these settings as there is no one-size-fits-all solution.

-- Christopher Markieta
kubernetes
openshift

1 Answer

11/6/2018

I think you kind of answered the question yourself. There's no size fit all, it really depends on the types of workloads. This also an opinion on how much slack you want to leave on the resources.

IMO

For compute resources:

  • CPUs and Memory: Anything under 10% is probably underutilized, anything over 80% overutilized. You always want to strive here for more utilization on both of these because these resources tend to be the ones that cost the most.
  • Disk: Anything at 80% means you probably need to increase the size of the disk, or do garbage collection.

For K8s resource limits like number of ConfigMaps there's no max per se, it's just a feature for you to make sure cluster users don't abuse resource creation just because cluster resources are never infinite. One example I can think of is you can say that every Deployment has on average 2 ConfigMaps and you'd like to have 100 Deployments and you might want to set a limit of 220 ConfigMaps.

-- Rico
Source: StackOverflow