concept quota in category kubernetes

This is an excerpt from Manning's book Kubernetes in Action.
A ResourceQuota limits the amount of computational resources the pods and the amount of storage PersistentVolumeClaims in a namespace can consume. It can also limit the number of pods, claims, and other API objects users are allowed to create inside the namespace. Because you’ve mostly dealt with CPU and memory so far, let’s start by looking at how to specify quotas for them.
The quotas you’ve created so far have applied to all pods, regardless of their current state and QoS class. But quotas can also be limited to a set of quota scopes. Four scopes are currently available: BestEffort, NotBestEffort, Terminating, and NotTerminating.
When creating a ResourceQuota, you can specify the scopes that it applies to. A pod must match all the specified scopes for the quota to apply to it. Additionally, what a quota can limit depends on the quota’s scope. BestEffort scope can only limit the number of pods, whereas the other three scopes can limit the number of pods, CPU/memory requests, and CPU/memory limits.
If, for example, you want the quota to apply only to BestEffort, NotTerminating pods, you can create the ResourceQuota object shown in the following listing.
Listing 14.17. ResourceQuota for BestEffort/NotTerminating pods: quota-scoped.yaml
apiVersion: v1 kind: ResourceQuota metadata: name: besteffort-notterminating-pods spec: scopes: #1 - BestEffort #1 - NotTerminating #1 hard: pods: 4 #2This quota ensures that at most four pods exist with the BestEffort QoS class, which don’t have an active deadline. If the quota was targeting NotBestEffort pods instead, you could also specify requests.cpu, requests.memory, limits.cpu, and limits.memory.