emsecrist
Flight Engineer
Flight Engineer
  • 661 Views

Quotas and Resource Requests and Limits

Jump to solution

If you have a Quota in place in the project, is it required that Resource Limits or Requests are in place for Pods in the project in order for new pods to be created? 

I am looking at some OReilly training that indicates as such, but don't see this information in the Red Hat training.

 

 

1 Solution

Accepted Solutions
Chetan_Tiwary_
Moderator
Moderator
  • 648 Views

Hello @emsecrist !

The official Kubernetes documentation mentions this : https://kubernetes.io/docs/concepts/policy/resource-quotas/#:~:text=If%20you%20enforce%20a%20resourc...

Chetan_Tiwary__0-1691011421950.png

 

Even if you do not explicitly specify how much memory or CPU a Pod can use, the Quota will still limit the total amount of resources that can be used by all Pods in the project. If the Quota is reached, new Pods will not be able to be created, even if they do not specify any Resource Limits or Requests.

Setting Resource Limits and Requests for Pods can give you more control over how much memory and CPU each Pod can use. This can help to ensure that your Pods do not use too many resources and that they do not get evicted from the cluster.

This is also a worth reading reference which is in sync with official K8 documentation : https://docs.openshift.com/container-platform/4.12/applications/quotas/quotas-setting-per-project.ht... 

In summary : Best Practice : If a resource quota applies to a resource request, then the pod should define a resource request. If a resource quota applies to a resource limit, then the pod should also define a resource limit. Even without quotas, you should define resource requests and limits.

View solution in original post

0 Kudos
1 Reply
Chetan_Tiwary_
Moderator
Moderator
  • 649 Views

Hello @emsecrist !

The official Kubernetes documentation mentions this : https://kubernetes.io/docs/concepts/policy/resource-quotas/#:~:text=If%20you%20enforce%20a%20resourc...

Chetan_Tiwary__0-1691011421950.png

 

Even if you do not explicitly specify how much memory or CPU a Pod can use, the Quota will still limit the total amount of resources that can be used by all Pods in the project. If the Quota is reached, new Pods will not be able to be created, even if they do not specify any Resource Limits or Requests.

Setting Resource Limits and Requests for Pods can give you more control over how much memory and CPU each Pod can use. This can help to ensure that your Pods do not use too many resources and that they do not get evicted from the cluster.

This is also a worth reading reference which is in sync with official K8 documentation : https://docs.openshift.com/container-platform/4.12/applications/quotas/quotas-setting-per-project.ht... 

In summary : Best Practice : If a resource quota applies to a resource request, then the pod should define a resource request. If a resource quota applies to a resource limit, then the pod should also define a resource limit. Even without quotas, you should define resource requests and limits.

0 Kudos
Join the discussion
You must log in to join this conversation.