@@ -206,17 +206,24 @@ ResourceQuota in that namespace.
206
206
当命名空间中存在一个 ResourceQuota 对象时,对于该命名空间而言,资源配额就是开启的。
207
207
208
208
<!--
209
- ## Compute Resource Quota
209
+ ## Types of resource quota
210
+
211
+ The ResourceQuota mechanism lets you enforce different kinds of limits. This
212
+ section describes the types of limit that you can enforce.
213
+
214
+ ### Quota for infrastructure resources {#compute-resource-quota}
210
215
211
216
You can limit the total sum of
212
217
[compute resources](/docs/concepts/configuration/manage-resources-containers/)
213
218
that can be requested in a given namespace.
214
219
-->
215
- ## 计算资源配额 {#compute-resource-quota}
220
+ ## 资源配额的类型 {#types-of-resource-quota}
221
+
222
+ ResourceQuota 机制允许你执行不同类别的限制。本节说明你可以执行的限制类型。
216
223
217
- 用户可以对给定命名空间下的可被请求的
218
- [ 计算资源 ] ( /zh-cn/docs/concepts/configuration/manage-resources-containers/ )
219
- 总量进行限制。
224
+ ### 基础设施资源的配额 {#compute-resource-quota}
225
+
226
+ 用户可以对给定命名空间下的可被请求的 [ 计算资源 ] ( /zh-cn/docs/concepts/configuration/manage-resources-containers/ ) 总量进行限制。
220
227
221
228
<!--
222
229
The following resource types are supported:
@@ -245,16 +252,15 @@ The following resource types are supported:
245
252
| ` memory ` | 与 ` requests.memory ` 相同。 |
246
253
247
254
<!--
248
- ### Resource Quota For Extended Resources
255
+ ### Quota for extended resources
249
256
250
257
In addition to the resources mentioned above, in release 1.10, quota support for
251
258
[extended resources](/docs/concepts/configuration/manage-resources-containers/#extended-resources) is added.
252
259
-->
253
- ### 扩展资源的资源配额 {#resource- quota-for-extended-resources}
260
+ ### 扩展资源的配额 {#quota-for-extended-resources}
254
261
255
262
除上述资源外,在 Kubernetes 1.10 版本中,
256
- 还添加了对[ 扩展资源] ( /zh-cn/docs/concepts/configuration/manage-resources-containers/#extended-resources )
257
- 的支持。
263
+ 还添加了对[ 扩展资源] ( /zh-cn/docs/concepts/configuration/manage-resources-containers/#extended-resources ) 的支持。
258
264
259
265
<!--
260
266
As overcommit is not allowed for extended resources, it makes no sense to specify both `requests`
@@ -279,19 +285,19 @@ See [Viewing and Setting Quotas](#viewing-and-setting-quotas) for more details.
279
285
有关更多详细信息,请参阅[ 查看和设置配额] ( #viewing-and-setting-quotas ) 。
280
286
281
287
<!--
282
- ## Storage Resource Quota
288
+ ### Quota for storage
283
289
284
- You can limit the total sum of [storage resources ](/docs/concepts/storage/persistent-volumes/)
290
+ You can limit the total sum of [storage](/docs/concepts/storage/persistent-volumes/) for volumes
285
291
that can be requested in a given namespace.
286
292
287
- In addition, you can limit consumption of storage resources based on associated storage-class.
293
+ In addition, you can limit consumption of storage resources based on associated
294
+ [StorageClass](/docs/concepts/storage/storage-classes/).
288
295
-->
289
- ## 存储资源配额 {#storage-resource-quota }
296
+ ## 存储的配额 {#quota-for-storage }
290
297
291
- 用户可以对给定命名空间下的[ 存储资源] ( /zh-cn/docs/concepts/storage/persistent-volumes/ )
292
- 总量进行限制。
298
+ 你可以对给定命名空间下可以请求的[ 存储卷] ( /zh-cn/docs/concepts/storage/persistent-volumes/ ) 总量进行限制。
293
299
294
- 此外,还可以根据相关的存储类(Storage Class) 来限制存储资源的消耗。
300
+ 此外,你还可以基于关联的 [ StorageClass ] ( /zh-cn/docs/concepts/storage/storage-classes/ ) 来限制存储资源的消耗。
295
301
296
302
<!--
297
303
| Resource Name | Description |
@@ -319,9 +325,11 @@ a `bronze` StorageClass, you can define a quota as follows:
319
325
* ` bronze.storageclass.storage.k8s.io/requests.storage: 100Gi `
320
326
321
327
<!--
322
- In release 1.8, quota support for local ephemeral storage is added as an alpha feature:
328
+ #### Quota for local ephemeral storage
323
329
-->
324
- 在 Kubernetes 1.8 版本中,本地临时存储的配额支持已经是 Alpha 功能:
330
+ #### 本地临时存储的配额
331
+
332
+ {{< feature-state for_k8s_version="v1.8" state="alpha" >}}
325
333
326
334
<!--
327
335
| Resource Name | Description |
@@ -340,84 +348,96 @@ In release 1.8, quota support for local ephemeral storage is added as an alpha f
340
348
<!--
341
349
When using a CRI container runtime, container logs will count against the ephemeral storage quota.
342
350
This can result in the unexpected eviction of pods that have exhausted their storage quotas.
351
+
343
352
Refer to [Logging Architecture](/docs/concepts/cluster-administration/logging/) for details.
344
353
-->
345
354
如果所使用的是 CRI 容器运行时,容器日志会被计入临时存储配额,
346
355
这可能会导致存储配额耗尽的 Pod 被意外地驱逐出节点。
356
+
347
357
参考[ 日志架构] ( /zh-cn/docs/concepts/cluster-administration/logging/ ) 了解详细信息。
348
358
{{< /note >}}
349
359
350
360
<!--
351
- ## Object Count Quota
361
+ ### Quota on object count
352
362
353
- You can set quota for *the total number of one particular resource kind* in the Kubernetes API,
363
+ You can set quota for *the total number of one particular {{< glossary_tooltip text=" resource" term_id="api-resource" >}} kind* in the Kubernetes API,
354
364
using the following syntax:
355
365
356
- * `count/<resource>.<group>` for resources from non-core groups
357
- * `count/<resource>` for resources from the core group
366
+ * `count/<resource>.<group>` for resources from non-core API groups
367
+ * `count/<resource>` for resources from the core API group
358
368
-->
359
- ## 对象数量配额 {#object-count-quota }
369
+ ### 对象数量的配额 {#quota-on- object-count}
360
370
361
- 你可以使用以下语法为 Kubernetes API 中“一种特定资源类型的总数”设置配额:
371
+ 你可以使用以下语法为 Kubernetes API
372
+ 中** 一种特定{{< glossary_tooltip text="资源" term_id="api-resource" >}}类型的总数** 设置配额:
362
373
363
- * ` count/<resource>.<group> ` :用于非核心(core) 组的资源
364
- * ` count/<resource> ` :用于核心组的资源
374
+ * ` count/<resource>.<group> ` :用于非核心 API 组的资源
375
+ * ` count/<resource> ` :用于核心 API 组的资源
365
376
366
377
<!--
367
- Here is an example set of resources users may want to put under object count quota:
378
+ For example, the PodTemplate API is in the core API group and so if you want to limit the number of
379
+ PodTemplate objects in a namespace, you use `count/podtemplates`.
380
+
381
+ These types of quotas are useful to protect against exhaustion of control plane storage. For example, you may
382
+ want to limit the number of Secrets in a server given their large size. Too many Secrets in a cluster can
383
+ actually prevent servers and controllers from starting. You can set a quota for Jobs to protect against
384
+ a poorly configured CronJob. CronJobs that create too many Jobs in a namespace can lead to a denial of service.
368
385
-->
369
- 这是用户可能希望利用对象计数配额来管理的一组资源示例:
386
+ 例如,PodTemplate API 属于核心 API 组,因此如果你想限制某个命名空间中的
387
+ PodTemplate 对象的数量,你可以使用 ` count/podtemplates ` 。
370
388
371
- * ` count/persistentvolumeclaims `
372
- * ` count/services `
373
- * ` count/secrets `
374
- * ` count/configmaps `
375
- * ` count/replicationcontrollers `
376
- * ` count/deployments.apps `
377
- * ` count/replicasets.apps `
378
- * ` count/statefulsets.apps `
379
- * ` count/jobs.batch `
380
- * ` count/cronjobs.batch `
389
+ 这类配额非常有助于防止控制平面存储资源耗尽。
390
+ 例如,由于某台服务器上的 Secret 较大,你可能希望对其进行限制。
391
+ 集群中 Secret 过多实际上可能导致服务器和控制器无法启动。
392
+ 你也可以为 Job 设置配额,以防止出现配置不当的 CronJob。
393
+ 某些 CronJob 如果在一个命名空间中创建了过多的 Job,可能会引发 DoS 攻击。
381
394
382
395
<!--
383
396
If you define a quota this way, it applies to Kubernetes' APIs that are part of the API server, and
384
- to any custom resources backed by a CustomResourceDefinition. If you use
385
- [API aggregation](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) to
397
+ to any custom resources backed by a CustomResourceDefinition.
398
+ For example, to create a quota on a `widgets` custom resource in the `example.com` API group,
399
+ use `count/widgets.example.com`.
400
+ If you use [API aggregation](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) to
386
401
add additional, custom APIs that are not defined as CustomResourceDefinitions, the core Kubernetes
387
402
control plane does not enforce quota for the aggregated API. The extension API server is expected to
388
403
provide quota enforcement if that's appropriate for the custom API.
389
- For example, to create a quota on a `widgets` custom resource in the `example.com` API group, use `count/widgets.example.com`.
390
404
-->
391
405
如果你以这种方式定义配额,它将应用于属于 API 服务器一部分的 Kubernetes API,以及 CustomResourceDefinition
392
- 支持的任何自定义资源。
406
+ 支持的任何自定义资源。例如,要在 ` example.com ` API 组中创建 ` widgets ` 定制资源的配额,可以使用 ` count/widgets.example.com ` 。
393
407
如果你使用[ 聚合 API] ( /zh-cn/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/ )
394
408
添加未定义为 CustomResourceDefinitions 的其他自定义 API,则核心 Kubernetes 控制平面不会对聚合 API 实施配额管理。
395
409
如果合适,扩展 API 服务器需要为自定义 API 提供配额管理。
396
- 例如,要对 ` example.com ` API 组中的自定义资源 ` widgets ` 设置配额,请使用
397
- ` count/widgets.example.com ` 。
398
410
399
411
<!--
400
- When using such a resource quota (nearly for all object kinds), an object is charged
401
- against the quota if the object kind exists (is defined) in the control plane.
402
- These types of quotas are useful to protect against exhaustion of storage resources. For example, you may
403
- want to limit the number of Secrets in a server given their large size. Too many Secrets in a cluster can
404
- actually prevent servers and controllers from starting. You can set a quota for Jobs to protect against
405
- a poorly configured CronJob. CronJobs that create too many Jobs in a namespace can lead to a denial of service.
412
+ ##### Generic syntax {#resource-quota-object-count-generic}
413
+
414
+ This is a list of common examples of object kinds that you may want to put under object count quota,
415
+ listed by the configuration string that you would use.
406
416
-->
407
- 当使用这样的资源配额(几乎涵盖所有对象类别)时,如果对象类别在控制平面中已存在(已定义),
408
- 则该对象管理会参考配额设置。
409
- 这些类型的配额有助于防止存储资源耗尽。例如,用户可能想根据服务器的存储能力来对服务器中
410
- Secret 的数量进行配额限制。
411
- 集群中存在过多的 Secret 实际上会导致服务器和控制器无法启动。
412
- 用户可以选择对 Job 进行配额管理,以防止配置不当的 CronJob 在某命名空间中创建太多
413
- Job 而导致集群拒绝服务。
417
+ ##### 通用语法 {#resource-quota-object-count-generic}
418
+
419
+ 以下是一些常见对象类别的示例,建议你为这些对象设置数量配额。每一项后面列出了相应的配置字符串:
420
+
421
+ * ` count/pods `
422
+ * ` count/persistentvolumeclaims `
423
+ * ` count/services `
424
+ * ` count/secrets `
425
+ * ` count/configmaps `
426
+ * ` count/deployments.apps `
427
+ * ` count/replicasets.apps `
428
+ * ` count/statefulsets.apps `
429
+ * ` count/jobs.batch `
430
+ * ` count/cronjobs.batch `
414
431
415
432
<!--
416
- There is another syntax only to set the same type of quota for certain resources.
433
+ ##### Specialized syntax {#resource-quota-object-count-specialized}
434
+
435
+ There is another syntax only to set the same type of quota, that only works for certain API kinds.
417
436
The following types are supported:
418
437
-->
419
- 还有另一种语法仅用于为某些资源设置相同类型的配额。
438
+ ##### 特殊语法 {#resource-quota-object-count-specialized}
420
439
440
+ 还有另一种语法只能设置相同类型的配额,只对某些 API 类别起作用。
421
441
支持以下类型:
422
442
423
443
<!--
0 commit comments