anchor.diff:      secrets: "10" <4>
       services: "10" <5>
   ----
  -<1> The total number of config maps that can exist in the project
  -<2> The total number of persistent volume claims that can exist in the project
  -<3> The total number of replication controllers that can exist in the project
  -<4> The total number of secrets that can exist in the project
  -<5> The total number of services that can exist in the project
  -====
  -
  -compute-resources.yaml
  +<1> The total number of `*ConfigMap*` objects that can exist in the project.
  +<2> The total number of persistent volume claims (PVCs) that can exist in the
  +project.
  +<3> The total number of replication controllers that can exist in the project.
  +<4> The total number of secrets that can exist in the project.
  +<5> The total number of services that can exist in the project.
  +====
  +
  +.*_compute-resources.yaml_*
   ====
   ----
   apiVersion: v1
  
positive.code:     limits.cpu: "2" <4>
      limits.memory: 2Gi <5>
  ----
  <1> The total number of pods in a non-terminal state that can exist in the project
  <2> Across all pods in a non-terminal state, the sum of cpu requests cannot exceed 1 core
  <3> Across all pods in a non-terminal state, the sum of memory requests cannot exceed 1Gi
  <4> Across all pods in a non-terminal state, the sum of cpu limits cannot exceed 2 cores
  <5> Across all pods in a non-terminal state, the sum of memory limits cannot exceed 2Gi
  ====
  
  besteffort.yaml
  ====
  ----
  apiVersion: v1
  
negative.code: :experimental:
  :toc: macro
  :toc-title:
  :prewrap!:
  
  toc::[]
  
  == Overview
  
  A resource quota, defined by a `*ResourceQuota*` object, provides constraints
  that limit aggregate resource consumption per project. It can limit the quantity
  of objects that can be created in a project by type, as well as the total amount
  of compute resources that may be consumed by resources in that project.
  
  ifdef::openshift-origin,openshift-enterprise,openshift-dedicated[]
  [NOTE]
  ====
  See the link:../dev_guide/compute_resources.html[Developer Guide] for more on
  compute resources.
  ====
  endif::[]
  
  [[resources-managed-by-quota]]
  == Resources Managed by Quota
  
  The following describes the set of resources that may be managed by a resource
  quota.
  
  [cols="3a,8a",options="header"]
  |===
  
  |Resource Name |Description
  
  |`*cpu*`
  |Across all pods in a non-terminal state, the sum of CPU requests cannot exceed
  this value.
  
  |`*memory*`
  |Across all pods in a non-terminal state, the sum of memory requests cannot
  exceed this value.
  
  |`*requests.cpu*`
  |Across all pods in a non-terminal state, the sum of CPU requests cannot exceed
  this value.
  
  |`*requests.memory*`
  |Across all pods in a non-terminal state, the sum of memory requests cannot
  exceed this value.
  
  |`*limits.cpu*`
  |Across all pods in a non-terminal state, the sum of CPU limits cannot exceed
  this value.
  
  |`*limits.memory*`
  |Across all pods in a non-terminal state, the sum of memory limits cannot exceed
  this value.
  
  |`*configmaps*`
  |The total number of `*ConfigMap*` objects that can exist in the project.
  
  |`*pods*`
  |The total number of pods in a non-terminal state that can exist in the project.
  A pod is in a terminal state if `status.phase in (Failed, Succeeded)` is true.
  
  |`*replicationcontrollers*`
  |The total number of replication controllers that can exist in the project.
  
  |`*resourcequotas*`
  |The total number of resource quotas that can exist in the project.
  
  |`*services*`
  |The total number of services that can exist in the project.
  
  |`*secrets*`
  |The total number of secrets that can exist in the project.
  
  |`*persistentvolumeclaims*`
  |The total number of persistent volume claims that can exist in the project.
  |===
  
  [[quota-scopes]]
  == Quota Scopes
  
  Each quota can have an associated set of _scopes_. A quota will only
  measure usage for a resource if it matches the intersection of enumerated
  scopes.
  
  Adding a scope to a quota limits the number of resources it supports to those
  that pertain to the scope. Specifying a resource on the quota outside of the
  allowed set would result in a validation error.
  
  [cols="3a,8a",options="header"]
  |===
  
  |Scope |Description
  
  |*Terminating*
  |Match pods where `spec.activeDeadlineSeconds >= 0`
  
  |*NotTerminating*
  |Match pods where `spec.activeDeadlineSeconds is nil`
  
  |*BestEffort*
  |Match pods that have best effort quality of service for either `*cpu*` or
  `*memory*`.
  
  |*NotBestEffort*
  |Match pods that do not have best effort quality of service for `*cpu*` and
  `*memory*`.
  |===
  
  A *BestEffort* scope restricts a quota to limit the following resources:
  
  - `*pods*`
  
  A *Terminating*, *NotTerminating*, and *NotBestEffort* scope restricts a quota
  to tracking the following resources:
  
  - `*pods*`
  - `*memory*`
  - `*requests.memory*`
  - `*limits.memory*`
  - `*cpu*`
  - `*requests.cpu*`
  - `*limits.cpu*`
  
  [[quota-enforcement]]
  == Quota Enforcement
  
  After a resource quota for a project is first created, the project restricts the
  ability to create any new resources that may violate a quota constraint until it
  has calculated updated usage statistics.
  
  After a quota is created and usage statistics are updated, the project accepts
  the creation of new content. When you create or modify resources, your quota
  usage is incremented immediately upon the request to create or modify the
  resource.
  
  When you delete a resource, your quota use is decremented during the next full
  recalculation of quota statistics for the project. When you delete resources, a
  link:#configuring-quota-sync-period[configurable amount of time] determines how
  long it takes to reduce quota usage statistics to their current observed system
  value.
  
  If project modifications exceed a quota usage limit, the server denies the
  action, and an appropriate error message is returned to the user explaining the
  quota constraint violated, and what their currently observed usage stats are in
  the system.
  
  [[requests-vs-limits]]
  === Requests vs Limits
  
  When allocating compute resources, each container may specify a request and a limit value
  for either CPU or memory. The quota can be configured to quota either value.
  
  If the quota has a value specified for `*requests.cpu*` or `*requests.memory*`,
  then it requires that every incoming container makes an explicit request for
  those resources. If the quota has a value specified for `*limits.cpu*` or
  `*limits.memory*`, then it requires that every incoming container specifies an
  explicit limit for those resources.
  
  == Sample Resource Quota Definitions
  
  .*_object-counts.yaml_*
  ====
  ----
  apiVersion: v1
  