@@ -66,6 +66,27 @@ Resource quotas work like this:
66
66
若想避免这类问题,请参考
67
67
[ 演练] ( /zh-cn/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/ ) 示例。
68
68
69
+ {{< note >}}
70
+ <!--
71
+ - For `cpu` and `memory` resources, ResourceQuotas enforce that **every**
72
+ (new) pod in that namespace sets a limit for that resource.
73
+ If you enforce a resource quota in a namespace for either `cpu` or `memory`,
74
+ you, and other clients, **must** specify either `requests` or `limits` for that resource,
75
+ for every new Pod you submit. If you don't, the control plane may reject admission
76
+ for that Pod.
77
+ - For other resources: ResourceQuota works and will ignore pods in the namespace without setting a limit or request for that resource. It means that you can create a new pod without limit/request ephemeral storage if the resource quota limits the ephemeral storage of this namespace.
78
+ You can use a [LimitRange](/docs/concepts/policy/limit-range/) to automatically set
79
+ a default request for these resources.
80
+ -->
81
+ - 对于 ` cpu ` 和 ` memory ` 资源:ResourceQuota 强制该命名空间中的每个(新)Pod 为该资源设置限制。
82
+ 如果你在命名空间中为 ` cpu ` 和 ` memory ` 制实施资源配额,
83
+ 你或其他客户端** 必须** 为你提交的每个新 Pod 指定该资源的 ` requests ` 或 ` limits ` 。
84
+ 否则,控制平面可能会拒绝接纳该 Pod。
85
+ - 对于其他资源:ResourceQuota 可以工作,并且会忽略命名空间中的 Pod,而无需为该资源设置限制或请求。
86
+ 这意味着,如果资源配额限制了此命名空间的临时存储,则可以创建没有限制/请求临时存储的新 Pod。
87
+ 你可以使用[ 限制范围] ( /zh-cn/docs/concepts/policy/limit-range/ ) 自动设置对这些资源的默认请求。
88
+ {{< /note >}}
89
+
69
90
<!--
70
91
The name of a ResourceQuota object must be a valid
71
92
[DNS subdomain name](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
@@ -106,7 +127,7 @@ enabled when the {{< glossary_tooltip text="API server" term_id="kube-apiserver"
106
127
`--enable-admission-plugins=` flag has `ResourceQuota` as
107
128
one of its arguments.
108
129
-->
109
- ## 启用资源配额
130
+ ## 启用资源配额 {#enabling-resource-quota}
110
131
111
132
资源配额的支持在很多 Kubernetes 版本中是默认启用的。
112
133
当 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}}
@@ -126,7 +147,7 @@ You can limit the total sum of
126
147
[compute resources](/docs/concepts/configuration/manage-resources-containers/)
127
148
that can be requested in a given namespace.
128
149
-->
129
- ## 计算资源配额
150
+ ## 计算资源配额 {#compute-resource-quota}
130
151
131
152
用户可以对给定命名空间下的可被请求的
132
153
[ 计算资源] ( /zh-cn/docs/concepts/configuration/manage-resources-containers/ )
@@ -164,7 +185,7 @@ The following resource types are supported:
164
185
In addition to the resources mentioned above, in release 1.10, quota support for
165
186
[extended resources](/docs/concepts/configuration/manage-resources-containers/#extended-resources) is added.
166
187
-->
167
- ### 扩展资源的资源配额
188
+ ### 扩展资源的资源配额 {#resource-quota-for-extended-resources}
168
189
169
190
除上述资源外,在 Kubernetes 1.10 版本中,还添加了对
170
191
[ 扩展资源] ( /zh-cn/docs/concepts/configuration/manage-resources-containers/#extended-resources )
@@ -199,7 +220,7 @@ You can limit the total sum of [storage resources](/docs/concepts/storage/persis
199
220
200
221
In addition, you can limit consumption of storage resources based on associated storage-class.
201
222
-->
202
- ## 存储资源配额
223
+ ## 存储资源配额 {#storage-resource-quota}
203
224
204
225
用户可以对给定命名空间下的[ 存储资源] ( /zh-cn/docs/concepts/storage/persistent-volumes/ )
205
226
总量进行限制。
@@ -270,7 +291,7 @@ namespaced resource types using the following syntax:
270
291
* `count/<resource>.<group>` for resources from non-core groups
271
292
* `count/<resource>` for resources from the core group
272
293
-->
273
- ## 对象数量配额
294
+ ## 对象数量配额 {#object-count-quota}
274
295
275
296
你可以使用以下语法对所有标准的、命名空间域的资源类型进行配额设置:
276
297
@@ -472,7 +493,7 @@ specified.
472
493
<!--
473
494
# ## Resource Quota Per PriorityClass
474
495
-->
475
- # ## 基于优先级类(PriorityClass)来设置资源配额
496
+ # ## 基于优先级类(PriorityClass)来设置资源配额 {#resource-quota-per-priorityclass}
476
497
477
498
{{< feature-state for_k8s_version="v1.17" state="stable" >}}
478
499
@@ -979,7 +1000,7 @@ restrictions around nodes: pods from several namespaces may run on the same node
979
1000
It may be desired that pods at a particular priority, eg. "cluster-services",
980
1001
should be allowed in a namespace, if and only if, a matching quota object exists.
981
1002
-->
982
- ## 默认情况下限制特定优先级的资源消耗
1003
+ ## 默认情况下限制特定优先级的资源消耗 {#limit-priority-class-consumption-by-default}
983
1004
984
1005
有时候可能希望当且仅当某名字空间中存在匹配的配额对象时,才可以创建特定优先级
985
1006
(例如 "cluster-services")的 Pod。
0 commit comments