Kubernetes 101 : Managing resources at the namespace level - Resource quotas for pods -

Resource requests and resource limits tell kubernetes how much CPU and RAM the pods could use.
These parameters are defined in the pod's Yaml file.

We could also limits the usage of resources in namespaces through a kubernetes object called the ResourceQuota.

ResourceQuotas are enabled through the API-server parameter for the admission controller plugin as follows "--enable-admission-plugins=ResourceQuota, ..." .

Below is the Yaml configuration file of a ResourceQuota:

The above configuration limits the number of pods to "150".

The above ResourceQuota could be applied to a namespace to limit the number of pods that could "live" in it to "150".

We first create a namespace called "namespace_quota" using the below command:

Then we attach the ResourceQuota "
resourcequota_1" to the "namespace_quota" namespace as follows:

If we try to create one more pod when the hard limit of "150" pods is reached, we will get an error message.

To check our ResourceQuota, we could use the below command:

To get more details about our ResourceQuota, we could do the following:


Leave as a comment: