Skip to content

Commit 75c426c

Browse files
authored
Merge pull request #47935 from my-git9/pp-9950
[zh-cn] sync manage-resources-containers assign-pod-node pod-lifecycle
2 parents 0b1f6a5 + 035e35e commit 75c426c

File tree

3 files changed

+74
-27
lines changed

3 files changed

+74
-27
lines changed

content/zh-cn/docs/concepts/configuration/manage-resources-containers.md

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ If you are administering a cluster or namespace, you can also set
497497
you may also want to define a [LimitRange](/docs/concepts/policy/limit-range/)
498498
for additional enforcement.
499499
If you specify a `spec.containers[].resources.limits.memory` for each Pod,
500-
then the muximum size of an `emptyDir` volume will be the pod's memory limit.
500+
then the maximum size of an `emptyDir` volume will be the pod's memory limit.
501501
-->
502502
如果你在管理集群或命名空间,还可以设置限制内存使用的 [ResourceQuota](/zh-cn/docs/concepts/policy/resource-quotas/);
503503
你可能还希望定义一个 [LimitRange](/zh-cn/docs/concepts/policy/limit-range/) 以施加额外的限制。如果为每个 Pod
@@ -905,7 +905,7 @@ that file but the kubelet does not categorize the space as in use.
905905

906906
{{% tab name="文件系统项目配额" %}}
907907

908-
{{< feature-state for_k8s_version="v1.15" state="alpha" >}}
908+
{{< feature-state feature_gate_name="LocalStorageCapacityIsolationFSQuotaMonitoring" >}}
909909

910910
<!--
911911
Project quotas are an operating-system level feature for managing
@@ -953,21 +953,37 @@ Kubernetes 所使用的项目 ID 始于 `1048576`。
953953
该文件会继续耗用存储空间。配额跟踪技术能够精确第记录对应存储空间的状态,
954954
而目录扫描方式会忽略被删除文件所占用的空间。
955955

956+
<!--
957+
To use quotas to track a pod's resource usage, the pod must be in
958+
a user namespace. Within user namespaces, the kernel restricts changes
959+
to projectIDs on the filesystem, ensuring the reliability of storage
960+
metrics calculated by quotas.
961+
-->
962+
要使用配额来跟踪 Pod 的资源使用情况,Pod 必须位于用户命名空间中。
963+
在用户命名空间内,内核限制对文件系统上 projectID 的更改,从而确保按配额计算的存储指标的可靠性。
964+
956965
<!--
957966
If you want to use project quotas, you should:
958967

959968
* Enable the `LocalStorageCapacityIsolationFSQuotaMonitoring=true`
960969
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
961970
using the `featureGates` field in the
962-
[kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/)
963-
or the `--feature-gates` command line flag.
971+
[kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/).
964972
-->
965973
如果你希望使用项目配额,你需要:
966974

967975
* 在 [kubelet 配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)中使用
968-
`featureGates` 字段或者使用 `--feature-gates` 命令行参数启用
976+
`featureGates` 字段启用
969977
`LocalStorageCapacityIsolationFSQuotaMonitoring=true` [特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)。
970978

979+
<!--
980+
* Ensure the `UserNamespacesSupport`
981+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
982+
is enabled, and that the kernel, CRI implementation and OCI runtime support user namespaces.
983+
-->
984+
* 确保 `UserNamespacesSupport` [特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)已启用,
985+
并且内核、CRI 实现和 OCI 运行时支持用户命名空间。
986+
971987
<!--
972988
* Ensure that the root filesystem (or optional runtime filesystem)
973989
has project quotas enabled. All XFS filesystems support project quotas.
@@ -996,6 +1012,20 @@ If you want to use project quotas, you should:
9961012
* 确保根文件系统(或者可选的运行时文件系统)在挂载时项目配额特性是被启用了的。
9971013
对于 XFS 和 ext4fs 而言,对应的挂载选项称作 `prjquota`。
9981014

1015+
<!--
1016+
If you don't want to use project quotas, you should:
1017+
1018+
* Disable the `LocalStorageCapacityIsolationFSQuotaMonitoring`
1019+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
1020+
using the `featureGates` field in the
1021+
[kubelet configuration](/docs/reference/config-api/kubelet-config.v1beta1/).
1022+
-->
1023+
如果不想使用项目配额,你应该:
1024+
1025+
* 使用 [kubelet 配置](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/)中的
1026+
`featureGates` 字段禁用 `LocalStorageCapacityIsolationFSQuotaMonitoring`
1027+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)。
1028+
9991029
{{% /tab %}}
10001030
{{< /tabs >}}
10011031

content/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -679,16 +679,16 @@ null `namespaceSelector` matches the namespace of the Pod where the rule is defi
679679
{{< feature-state feature_gate_name="MatchLabelKeysInPodAffinity" >}}
680680

681681
{{< note >}}
682-
<!-- UPDATE THIS WHEN PROMOTING TO BETA -->
682+
<!-- UPDATE THIS WHEN PROMOTING TO STABLE -->
683683
<!--
684-
The `matchLabelKeys` field is an alpha-level field and is disabled by default in
684+
The `matchLabelKeys` field is an beta-level field and is disabled by default in
685685
Kubernetes {{< skew currentVersion >}}.
686-
When you want to use it, you have to enable it via the
686+
When you want to disable it, you have to disable it explicitly via the
687687
`MatchLabelKeysInPodAffinity` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
688688
-->
689-
`matchLabelKeys` 字段是一个 Alpha 级别的字段,在 Kubernetes {{< skew currentVersion >}} 中默认被禁用。
690-
当你想要使用此字段时,你必须通过 `MatchLabelKeysInPodAffinity`
691-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)启用它
689+
`matchLabelKeys` 字段是一个 Beta 级别的字段,在 Kubernetes {{< skew currentVersion >}} 中默认被禁用。
690+
当你想要禁用此字段时,你必须通过 `MatchLabelKeysInPodAffinity`
691+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)禁用它
692692
{{< /note >}}
693693

694694
<!--
@@ -753,16 +753,16 @@ spec:
753753
{{< feature-state feature_gate_name="MatchLabelKeysInPodAffinity" >}}
754754

755755
{{< note >}}
756-
<!-- UPDATE THIS WHEN PROMOTING TO BETA -->
756+
<!-- UPDATE THIS WHEN PROMOTING TO STABLE -->
757757
<!--
758-
The `mismatchLabelKeys` field is an alpha-level field and is disabled by default in
758+
The `mismatchLabelKeys` field is an beta-level field and is disabled by default in
759759
Kubernetes {{< skew currentVersion >}}.
760-
When you want to use it, you have to enable it via the
760+
When you want to disable it, you have to disable it explicitly via the
761761
`MatchLabelKeysInPodAffinity` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/).
762762
-->
763-
`mismatchLabelKeys` 字段是一个 Alpha 级别的字段,在 Kubernetes {{< skew currentVersion >}} 中默认被禁用。
764-
当你想要使用此字段时,你必须通过 `MatchLabelKeysInPodAffinity`
765-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)启用它
763+
`mismatchLabelKeys` 字段是一个 Beta 级别的字段,在 Kubernetes {{< skew currentVersion >}} 中默认被禁用。
764+
当你想要禁用此字段时,你必须通过 `MatchLabelKeysInPodAffinity`
765+
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)禁用它
766766
{{< /note >}}
767767

768768
<!--

content/zh-cn/docs/concepts/workloads/pods/pod-lifecycle.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,31 @@ Value | Description
219219

220220
{{< note >}}
221221
<!--
222-
When a Pod is being deleted, it is shown as `Terminating` by some kubectl commands.
223-
This `Terminating` status is not one of the Pod phases.
222+
When a pod is failing to start repeatedly, `CrashLoopBackOff` may appear in the `Status` field of some kubectl commands. Similarly, when a pod is being deleted, `Terminating` may appear in the `Status` field of some kubectl commands.
223+
224+
Make sure not to confuse _Status_, a kubectl display field for user intuition, with the pod's `phase`.
225+
Pod phase is an explicit part of the Kubernetes data model and of the
226+
[Pod API](/docs/reference/kubernetes-api/workload-resources/pod-v1/).
227+
-->
228+
当 Pod 反复启动失败时,某些 kubectl 命令的 `Status` 字段中可能会出现 `CrashLoopBackOff`
229+
同样,当 Pod 被删除时,某些 kubectl 命令的 `Status` 字段中可能会出现 `Terminating`
230+
231+
确保不要将 **Status**(kubectl 用于用户直觉的显示字段)与 Pod 的 `phase` 混淆。
232+
Pod 阶段(phase)是 Kubernetes 数据模型和
233+
[Pod API](/zh-cn/docs/reference/kubernetes-api/workload-resources/pod-v1/)
234+
的一个明确的部分。
235+
236+
```console
237+
NAMESPACE NAME READY STATUS RESTARTS AGE
238+
alessandras-namespace alessandras-pod 0/1 CrashLoopBackOff 200 2d9h
239+
```
240+
241+
---
242+
243+
<!--
224244
A Pod is granted a term to terminate gracefully, which defaults to 30 seconds.
225245
You can use the flag `--force` to [terminate a Pod by force](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination-forced).
226246
-->
227-
当一个 Pod 被删除时,执行一些 kubectl 命令会展示这个 Pod 的状态为 `Terminating`(终止)。
228-
这个 `Terminating` 状态并不是 Pod 阶段之一。
229247
Pod 被赋予一个可以体面终止的期限,默认为 30 秒。
230248
你可以使用 `--force` 参数来[强制终止 Pod](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination-forced)
231249
{{< /note >}}
@@ -897,7 +915,7 @@ specify a liveness probe, and specify a `restartPolicy` of Always or OnFailure.
897915
<!--
898916
#### When should you use a readiness probe?
899917
-->
900-
#### 何时该使用就绪态探针? {#when-should-you-use-a-readiness-probe}
918+
#### 何时该使用就绪态探针 {#when-should-you-use-a-readiness-probe}
901919

902920
<!--
903921
If you'd like to start sending traffic to a Pod only when a probe succeeds,
@@ -1227,7 +1245,8 @@ documentation for
12271245
[deleting Pods from a StatefulSet](/docs/tasks/run-application/force-delete-stateful-set-pod/).
12281246
-->
12291247
如果你需要强制删除 StatefulSet 的 Pod,
1230-
请参阅[从 StatefulSet 中删除 Pod](/zh-cn/docs/tasks/run-application/force-delete-stateful-set-pod/) 的任务文档。
1248+
请参阅[从 StatefulSet 中删除 Pod](/zh-cn/docs/tasks/run-application/force-delete-stateful-set-pod/)
1249+
的任务文档。
12311250

12321251
<!--
12331252
### Pod shutdown and sidecar containers {##termination-with-sidecars}
@@ -1295,8 +1314,7 @@ Additionally, PodGC cleans up any Pods which satisfy any of the following condit
12951314
[`node.kubernetes.io/out-of-service`](/docs/reference/labels-annotations-taints/#node-kubernetes-io-out-of-service),
12961315
when the `NodeOutOfServiceVolumeDetach` feature gate is enabled.
12971316
1298-
When the `PodDisruptionConditions` feature gate is enabled, along with
1299-
cleaning up the Pods, PodGC will also mark them as failed if they are in a non-terminal
1317+
Along with cleaning up the Pods, PodGC will also mark them as failed if they are in a non-terminal
13001318
phase. Also, PodGC adds a Pod disruption condition when cleaning up an orphan Pod.
13011319
See [Pod disruption conditions](/docs/concepts/workloads/pods/disruptions#pod-disruption-conditions)
13021320
for more details.
@@ -1309,8 +1327,7 @@ for more details.
13091327
绑定到有 [`node.kubernetes.io/out-of-service`](/zh-cn/docs/reference/labels-annotations-taints/#node-kubernetes-io-out-of-service)
13101328
污点的未就绪节点。
13111329

1312-
若启用 `PodDisruptionConditions` 特性门控,在清理 Pod 的同时,
1313-
如果它们处于非终止状态阶段,PodGC 也会将它们标记为失败。
1330+
在清理 Pod 的同时,如果它们处于非终止状态阶段,PodGC 也会将它们标记为失败。
13141331
此外,PodGC 在清理孤儿 Pod 时会添加 Pod 干扰状况。参阅
13151332
[Pod 干扰状况](/zh-cn/docs/concepts/workloads/pods/disruptions#pod-disruption-conditions) 了解更多详情。
13161333

0 commit comments

Comments
 (0)