Kubernetes: Resource Quota

A Resource Quota in Kubernetes is an object that allow us to limit the amount of resource a pod can consume. Without a resource Quota, pods are able to consume as much resource as available in the cluster. Once a resource quota is applied to a namespace the resource consumption will be limited within that namespace. setting of a resource Quota is import because it allows fair usage and favorable QOS within the cluster. We have three kinds of resource Quotas which are storage, compute and object count quotes. Once a resource quota is specified and a pod makes a request that exceeds the Resource Quota, the pod won’t start. here is an example of a Resource Quota. In this example, we have set resource Quota for storage, cpu and object.

kind: ResourceQuota
apiVersion: v1
metadata:
  name: dev-quota
spec:
  hard:
   requests.cpu: "2"              
   requests.memory: 2Gi                     
   limits.cpu: "4"           
   limits.memory: 4Gi        
   requests.storage: 128Gi    
   pods: 3    

One thought on “Kubernetes: Resource Quota”

Leave a Reply

Your email address will not be published. Required fields are marked *