<p>Please explain the difference between <code>ResourceQuota</code> vs <code>LimitRange</code> objects in Kubernetes...?</p>

<p><code>LimitRange</code> and <code>ResourceQuota</code> are objects used to control resource usage by a Kubernetes cluster administrator.</p>

<p><code>ResourceQuota</code> is for limiting the total resource consumption of a namespace, for example:</p>

<pre><code>apiVersion: v1
kind: ResourceQuota
metadata:
  name: object-counts
spec:
  hard:
    configmaps: "10" 
    persistentvolumeclaims: "4" 
    replicationcontrollers: "20" 
    secrets: "10" 
    services: "10"
</code></pre>

<p><code>LimitRange</code>is for managing constraints at a pod and container level within the project.</p>

<pre><code>apiVersion: "v1"
kind: "LimitRange"
metadata:
  name: "resource-limits" 
spec:
  limits:
    -
      type: "Pod"
      max:
        cpu: "2" 
        memory: "1Gi" 
      min:
        cpu: "200m" 
        memory: "6Mi" 
    -
      type: "Container"
      max:
        cpu: "2" 
        memory: "1Gi" 
      min:
        cpu: "100m" 
        memory: "4Mi" 
      default:
        cpu: "300m" 
        memory: "200Mi" 
      defaultRequest:
        cpu: "200m" 
        memory: "100Mi" 
      maxLimitRequestRatio:
        cpu: "10" 
</code></pre>

<p>An individual Pod or Container that requests resources outside of these <code>LimitRange</code> constraints will be rejected, whereas a <code>ResourceQuota</code> only applies to all of the namespace/project's objects in aggregate.</p>
