kubernetes quota vs limit. What are they? How are they different? When should I use one or the other?
ResourceQuota is

the total amount of memory and CPU that can be used by all Containers running in a namespace

LimitRangeis

if ... the Container does not specify its own CPU limit, then the Container is assigned the default CPU limit


Example of ResourceQuota:

Imagine you have 2 namespaces in the same cluster, the namespace &quot;backup&quot; and namespace &quot;test&quot;. &quot;backup&quot; run critical pods and you want to guarantee that will always have enough resources (CPU and memory) to run it. So you can configure a ResourceQuota in the namespace &quot;test&quot; to use only a part of the total amount of CPU and memory in your cluster.
Is like you say to k8s: &quot;The sum of all memory and CPU of all pods in the namespace &quot;test&quot; can't be higher than what is specified in the ResourceQuota, 20G for memory and 12 vCPU's&quot;

Example of LimitRange:

You can specify in the yaml the minimum and maximum amount of CPU and memory a container can consume but instead of configuring in every yaml file you can set a default value with LimitRange.
Is like you say to k8s: &quot;If there is no resource configured in the yaml file apply this LimitRange.