Skip to content

Commit c02f3e0

Browse files
authored
Merge pull request #37327 from my-git9/limit-range5
[zh-cn] sync docs/concepts/policy/limit-range.md
2 parents 84c0b93 + 18b7f58 commit c02f3e0

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

content/zh-cn/docs/concepts/policy/limit-range.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,34 +93,38 @@ LimitRange 的名称必须是合法的
9393
9494
A `LimitRange` does **not** check the consistency of the default values it applies. This means that a default value for the _limit_ that is set by `LimitRange` may be less than the _request_ value specified for the container in the spec that a client submits to the API server. If that happens, the final Pod will not be scheduleable.
9595
96-
For example, if "LimitRange` is defined as following:
96+
For example, you define a `LimitRange` with this manifest:
9797
-->
9898
## Pod 的 LimitRange 和准入检查 {#limitrange-and-admission-checks-for-pod}
9999

100100
`LimitRange` **** 检查所应用的默认值的一致性。
101101
这意味着 `LimitRange` 设置的 **limit** 的默认值可能小于客户端提交给 API 服务器的规约中为容器指定的 **request** 值。
102102
如果发生这种情况,最终 Pod 将无法调度。
103103

104-
例如若按如下方式定义 `LimitRange`
104+
例如,你使用如下清单定义一个 `LimitRange`
105105

106106
{{< codenew file="concepts/policy/limit-range/problematic-limit-range.yaml" >}}
107107

108108
<!--
109-
The following Pod that declares the Request of `700m`, but not the limit:
109+
along with a Pod that declares a CPU resource request of `700m`, but not a limit:
110110
-->
111-
以下 Pod 声明请求值为 `700m` 但未声明限制值
111+
以及一个声明 CPU 资源请求为 `700m` 但未声明限制值的 Pod
112112

113113
{{< codenew file="concepts/policy/limit-range/example-conflict-with-limitrange-cpu.yaml" >}}
114114

115115
<!--
116-
This Pod will not be scheduled with the error `Pod "ConflictingCpuSettings" is invalid: spec.containers[0].resources.requests: Invalid value: "700m": must be less than or equal to cpu limit`
117-
118-
If both, request and limit are set, the Pod will be scheduled successfully with the same `LimitRange` object:
116+
then that Pod will not be scheduled, failing with an error similar to:
119117
-->
120-
此 Pod 将不会被调度并报错:
121-
`Pod "ConflictingCpuSettings" is invalid: spec.containers[0].resources.requests: Invalid value: "700m": must be less than or equal to cpu limit`
118+
那么该 Pod 将不会被调度,失败并出现类似以下的错误:
119+
120+
```
121+
Pod "example-conflict-with-limitrange-cpu" is invalid: spec.containers[0].resources.requests: Invalid value: "700m": must be less than or equal to cpu limit
122+
```
122123

123-
如果同时设置了请求和限制,Pod 将随相同的 `LimitRange` 对象被成功调度:
124+
<!--
125+
If you set both `request` and `limit`, then that new Pod will be scheduled successfully even with the same `LimitRange` in place:
126+
-->
127+
如果你同时设置了 `request``limit`,那么即使使用相同的 `LimitRange`,新 Pod 也会被成功调度:
124128

125129
{{< codenew file="concepts/policy/limit-range/example-no-conflict-with-limitrange-cpu.yaml" >}}
126130

@@ -155,11 +159,6 @@ Neither contention nor changes to a LimitRange will affect already created resou
155159

156160
## {{% heading "whatsnext" %}}
157161

158-
<!--
159-
Refer to the [LimitRanger design document](https://git.k8s.io/design-proposals-archive/resource-management/admission_control_limit_range.md) for more information.
160-
-->
161-
参阅 [LimitRanger 设计文档](https://git.k8s.io/design-proposals-archive/resource-management/admission_control_limit_range.md)获取更多信息。
162-
163162
<!--
164163
For examples on using limits, see:
165164
@@ -169,6 +168,8 @@ For examples on using limits, see:
169168
- [how to configure default Memory Requests and Limits per namespace](/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/).
170169
- [how to configure minimum and maximum Storage consumption per namespace](/docs/tasks/administer-cluster/limit-storage-consumption/#limitrange-to-limit-requests-for-storage).
171170
- a [detailed example on configuring quota per namespace](/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/).
171+
172+
Refer to the [LimitRanger design document](https://git.k8s.io/design-proposals-archive/resource-management/admission_control_limit_range.md) for context and historical information.
172173
-->
173174
关于使用限值的例子,可参阅:
174175

@@ -179,3 +180,4 @@ For examples on using limits, see:
179180
- [如何配置每个命名空间最小和最大存储使用量](/zh-cn/docs/tasks/administer-cluster/limit-storage-consumption/#limitrange-to-limit-requests-for-storage)
180181
- [配置每个命名空间的配额的详细例子](/zh-cn/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/)
181182

183+
有关上下文和历史信息,请参阅 [LimitRanger 设计文档](https://git.k8s.io/design-proposals-archive/resource-management/admission_control_limit_range.md)

0 commit comments

Comments
 (0)