Skip to content

Commit 7c019ea

Browse files
committed
Describe kinds of ResourceQuota
1 parent 9872429 commit 7c019ea

File tree

1 file changed

+46
-27
lines changed

1 file changed

+46
-27
lines changed

content/en/docs/concepts/policy/resource-quotas.md

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ one of its arguments.
104104
A resource quota is enforced in a particular namespace when there is a
105105
ResourceQuota in that namespace.
106106

107-
## Compute Resource Quota
107+
## Types of resource quota
108+
109+
The ResourceQuota mechanism lets you enforce different kinds of limits. This
110+
section describes the types of limit that you can enforce.
111+
112+
### Quota for infrastructure resources {#compute-resource-quota}
108113

109114
You can limit the total sum of
110115
[compute resources](/docs/concepts/configuration/manage-resources-containers/)
@@ -122,7 +127,7 @@ The following resource types are supported:
122127
| `cpu` | Same as `requests.cpu` |
123128
| `memory` | Same as `requests.memory` |
124129

125-
### Resource Quota For Extended Resources
130+
### Quota for extended resources
126131

127132
In addition to the resources mentioned above, in release 1.10, quota support for
128133
[extended resources](/docs/concepts/configuration/manage-resources-containers/#extended-resources) is added.
@@ -138,12 +143,13 @@ limit the total number of GPUs requested in a namespace to 4, you can define a q
138143

139144
See [Viewing and Setting Quotas](#viewing-and-setting-quotas) for more details.
140145

141-
## Storage Resource Quota
146+
### Quota for storage
142147

143-
You can limit the total sum of [storage resources](/docs/concepts/storage/persistent-volumes/)
148+
You can limit the total sum of [storage](/docs/concepts/storage/persistent-volumes/) for volumes
144149
that can be requested in a given namespace.
145150

146-
In addition, you can limit consumption of storage resources based on associated storage-class.
151+
In addition, you can limit consumption of storage resources based on associated
152+
[StorageClass](/docs/concepts/storage/storage-classes/).
147153

148154
| Resource Name | Description |
149155
| ------------- | ----------- |
@@ -158,7 +164,10 @@ a `bronze` StorageClass, you can define a quota as follows:
158164
* `gold.storageclass.storage.k8s.io/requests.storage: 500Gi`
159165
* `bronze.storageclass.storage.k8s.io/requests.storage: 100Gi`
160166

161-
In release 1.8, quota support for local ephemeral storage is added as an alpha feature:
167+
#### Quota for local ephemeral storage
168+
169+
{{< feature-state for_k8s_version="v1.8" state="alpha" >}}
170+
162171

163172
| Resource Name | Description |
164173
| ------------- | ----------- |
@@ -169,46 +178,56 @@ In release 1.8, quota support for local ephemeral storage is added as an alpha f
169178
{{< note >}}
170179
When using a CRI container runtime, container logs will count against the ephemeral storage quota.
171180
This can result in the unexpected eviction of pods that have exhausted their storage quotas.
181+
172182
Refer to [Logging Architecture](/docs/concepts/cluster-administration/logging/) for details.
173183
{{< /note >}}
174184

175-
## Object Count Quota
185+
### Quota on object count
176186

177-
You can set quota for *the total number of one particular resource kind* in the Kubernetes API,
187+
You can set quota for *the total number of one particular {{< glossary_tooltip text="resource" term_id="api-resource" >}} kind* in the Kubernetes API,
178188
using the following syntax:
179189

180-
* `count/<resource>.<group>` for resources from non-core groups
181-
* `count/<resource>` for resources from the core group
190+
* `count/<resource>.<group>` for resources from non-core API groups
191+
* `count/<resource>` for resources from the core API group
192+
193+
For example, the PodTemplate API is in the core API group and so if you want to limit the number of
194+
PodTemplate objects in a namespace, you use `count/podtemplates`.
195+
196+
These types of quotas are useful to protect against exhaustion of control plane storage. For example, you may
197+
want to limit the number of Secrets in a server given their large size. Too many Secrets in a cluster can
198+
actually prevent servers and controllers from starting. You can set a quota for Jobs to protect against
199+
a poorly configured CronJob. CronJobs that create too many Jobs in a namespace can lead to a denial of service.
200+
201+
202+
203+
If you define a quota this way, it applies to Kubernetes' APIs that are part of the API server, and
204+
to any custom resources backed by a CustomResourceDefinition.
205+
For example, to create a quota on a `widgets` custom resource in the `example.com` API group,
206+
use `count/widgets.example.com`.
207+
If you use [API aggregation](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) to
208+
add additional, custom APIs that are not defined as CustomResourceDefinitions, the core Kubernetes
209+
control plane does not enforce quota for the aggregated API. The extension API server is expected to
210+
provide quota enforcement if that's appropriate for the custom API.
182211

183-
Here is an example set of resources users may want to put under object count quota:
212+
##### Generic syntax {#resource-quota-object-count-generic}
184213

214+
This is a list of common examples of object kinds that you may want to put under object count quota,
215+
listed by the configuration string that you would use.
216+
217+
* `count/pods`
185218
* `count/persistentvolumeclaims`
186219
* `count/services`
187220
* `count/secrets`
188221
* `count/configmaps`
189-
* `count/replicationcontrollers`
190222
* `count/deployments.apps`
191223
* `count/replicasets.apps`
192224
* `count/statefulsets.apps`
193225
* `count/jobs.batch`
194226
* `count/cronjobs.batch`
195227

196-
If you define a quota this way, it applies to Kubernetes' APIs that are part of the API server, and
197-
to any custom resources backed by a CustomResourceDefinition. If you use
198-
[API aggregation](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) to
199-
add additional, custom APIs that are not defined as CustomResourceDefinitions, the core Kubernetes
200-
control plane does not enforce quota for the aggregated API. The extension API server is expected to
201-
provide quota enforcement if that's appropriate for the custom API.
202-
For example, to create a quota on a `widgets` custom resource in the `example.com` API group, use `count/widgets.example.com`.
203-
204-
When using such a resource quota (nearly for all object kinds), an object is charged
205-
against the quota if the object kind exists (is defined) in the control plane.
206-
These types of quotas are useful to protect against exhaustion of storage resources. For example, you may
207-
want to limit the number of Secrets in a server given their large size. Too many Secrets in a cluster can
208-
actually prevent servers and controllers from starting. You can set a quota for Jobs to protect against
209-
a poorly configured CronJob. CronJobs that create too many Jobs in a namespace can lead to a denial of service.
228+
##### Specialized syntax {#resource-quota-object-count-specialized}
210229

211-
There is another syntax only to set the same type of quota for certain resources.
230+
There is another syntax only to set the same type of quota, that only works for certain API kinds.
212231
The following types are supported:
213232

214233
| Resource Name | Description |

0 commit comments

Comments
 (0)