@@ -104,7 +104,12 @@ one of its arguments.
104
104
A resource quota is enforced in a particular namespace when there is a
105
105
ResourceQuota in that namespace.
106
106
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}
108
113
109
114
You can limit the total sum of
110
115
[ compute resources] ( /docs/concepts/configuration/manage-resources-containers/ )
@@ -122,7 +127,7 @@ The following resource types are supported:
122
127
| ` cpu ` | Same as ` requests.cpu ` |
123
128
| ` memory ` | Same as ` requests.memory ` |
124
129
125
- ### Resource Quota For Extended Resources
130
+ ### Quota for extended resources
126
131
127
132
In addition to the resources mentioned above, in release 1.10, quota support for
128
133
[ 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
138
143
139
144
See [ Viewing and Setting Quotas] ( #viewing-and-setting-quotas ) for more details.
140
145
141
- ## Storage Resource Quota
146
+ ### Quota for storage
142
147
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
144
149
that can be requested in a given namespace.
145
150
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/ ) .
147
153
148
154
| Resource Name | Description |
149
155
| ------------- | ----------- |
@@ -158,7 +164,10 @@ a `bronze` StorageClass, you can define a quota as follows:
158
164
* ` gold.storageclass.storage.k8s.io/requests.storage: 500Gi `
159
165
* ` bronze.storageclass.storage.k8s.io/requests.storage: 100Gi `
160
166
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
+
162
171
163
172
| Resource Name | Description |
164
173
| ------------- | ----------- |
@@ -169,46 +178,56 @@ In release 1.8, quota support for local ephemeral storage is added as an alpha f
169
178
{{< note >}}
170
179
When using a CRI container runtime, container logs will count against the ephemeral storage quota.
171
180
This can result in the unexpected eviction of pods that have exhausted their storage quotas.
181
+
172
182
Refer to [ Logging Architecture] ( /docs/concepts/cluster-administration/logging/ ) for details.
173
183
{{< /note >}}
174
184
175
- ## Object Count Quota
185
+ ### Quota on object count
176
186
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,
178
188
using the following syntax:
179
189
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.
182
211
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}
184
213
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 `
185
218
* ` count/persistentvolumeclaims `
186
219
* ` count/services `
187
220
* ` count/secrets `
188
221
* ` count/configmaps `
189
- * ` count/replicationcontrollers `
190
222
* ` count/deployments.apps `
191
223
* ` count/replicasets.apps `
192
224
* ` count/statefulsets.apps `
193
225
* ` count/jobs.batch `
194
226
* ` count/cronjobs.batch `
195
227
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}
210
229
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 .
212
231
The following types are supported:
213
232
214
233
| Resource Name | Description |
0 commit comments