diff --git a/content/zh-cn/docs/concepts/overview/working-with-objects/finalizers.md b/content/zh-cn/docs/concepts/overview/working-with-objects/finalizers.md index db6f51514f4ee..21654acda9e20 100644 --- a/content/zh-cn/docs/concepts/overview/working-with-objects/finalizers.md +++ b/content/zh-cn/docs/concepts/overview/working-with-objects/finalizers.md @@ -87,7 +87,7 @@ Kubernetes 清除 `pv-protection` Finalizer,控制器就会删除该卷。 ## Owner references, labels, and finalizers {#owners-labels-finalizers} Like {{}}, -[owner references](/concepts/overview/working-with-objects/owners-dependents/) +[owner references](/docs/concepts/overview/working-with-objects/owners-dependents/) describe the relationships between objects in Kubernetes, but are used for a different purpose. When a {{}} manages objects @@ -99,7 +99,7 @@ any Pods in the cluster with the same label. ## 属主引用、标签和 Finalizers {#owners-labels-finalizers} 与{{}}类似, -[属主引用](/zh-cn/concepts/overview/working-with-objects/owners-dependents/) +[属主引用](/zh-cn/docs/concepts/overview/working-with-objects/owners-dependents/) 描述了 Kubernetes 中对象之间的关系,但它们作用不同。 当一个{{}} 管理类似于 Pod 的对象时,它使用标签来跟踪相关对象组的变化。 @@ -154,4 +154,3 @@ Finalizers 通常因为特殊原因被添加到资源上,所以强行删除它 on the Kubernetes blog. --> * 在 Kubernetes 博客上阅读[使用 Finalizers 控制删除](/blog/2021/05/14/using-finalizers-to-control-deletion/)。 - diff --git a/content/zh-cn/docs/concepts/security/pod-security-policy.md b/content/zh-cn/docs/concepts/security/pod-security-policy.md index d68df8050c50e..31137aab7f2c6 100644 --- a/content/zh-cn/docs/concepts/security/pod-security-policy.md +++ b/content/zh-cn/docs/concepts/security/pod-security-policy.md @@ -58,7 +58,7 @@ Pod 安全策略允许管理员控制如下方面: -### 创建一个策略和一个 Pod +### 创建一个策略和一个 Pod {#create-a-policy-and-a-pod} 在一个文件中定义一个示例的 PodSecurityPolicy 对象。 这里的策略只是用来禁止创建有特权要求的 Pods。 @@ -588,7 +588,7 @@ spec: EOF ``` 输出类似于: @@ -791,7 +791,8 @@ several security mechanisms. {{< codenew file="policy/restricted-psp.yaml" >}} 更多的示例可参考 [Pod 安全标准](/zh-cn/docs/concepts/security/pod-security-standards/#policy-instantiation)。 @@ -897,10 +898,10 @@ PodSecurityPolicy 并不限制可以被 `PersistentVolumeClaim` 所引用的 **FSGroup** - Controls the supplemental group applied to some volumes. - *MustRunAs* - Requires at least one `range` to be specified. Uses the -minimum value of the first range as the default. Validates against all ranges. + minimum value of the first range as the default. Validates against all ranges. - *MayRunAs* - Requires at least one `range` to be specified. Allows -`FSGroups` to be left unset without providing a default. Validates against -all ranges if `FSGroups` is set. + `FSGroups` to be left unset without providing a default. Validates against + all ranges if `FSGroups` is set. - *RunAsAny* - No default provided. Allows any `fsGroup` ID to be specified. --> **FSGroup** - 控制应用到某些卷上的附加用户组。 @@ -1054,7 +1055,7 @@ spec: ### 特权提升 {#privilege-escalation} -这一组选项控制容器的`allowPrivilegeEscalation` 属性。该属性直接决定是否为容器进程设置 +这一组选项控制容器的 `allowPrivilegeEscalation` 属性。该属性直接决定是否为容器进程设置 [`no_new_privs`](https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt) 参数。此参数会禁止 `setuid` 属性的可执行文件更改有效用户 ID(EUID), 并且禁止启用额外权能的文件。例如,`no_new_privs` 会禁止使用 `ping` 工具。 @@ -1140,7 +1141,7 @@ the PodSecurityPolicy. For more details on Linux capabilities, see [capabilities(7)](http://man7.org/linux/man-pages/man7/capabilities.7.html). The following fields take a list of capabilities, specified as the capability -name in ALL_CAPS without the `CAP\_` prefix. +name in ALL_CAPS without the `CAP_` prefix. --> ### 权能字 {#capabilities} @@ -1176,7 +1177,7 @@ added. Capabilities listed in `RequiredDropCapabilities` must not be included in **DefaultAddCapabilities** - 默认添加到容器的权能字集合。 这一集合是作为容器运行时所设值的补充。 @@ -1228,14 +1229,14 @@ denoted as the string `Unmasked`. ### AppArmor 通过 PodSecurityPolicy 上的注解来控制。 详情请参阅 -[AppArmor 文档](/zh-cn/docs/tutorials/policy/apparmor/#podsecuritypolicy-annotations)。 +[AppArmor 文档](/zh-cn/docs/tutorials/security/apparmor/#podsecuritypolicy-annotations)。 - 参阅 [PodSecurityPolicy Deprecation: Past, Present, and Future](/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/), 了解 Pod 安全策略的未来。 -- 参阅[Pod 安全标准](/zh-cn/docs/concepts/security/pod-security-standards/), +- 参阅 [Pod 安全标准](/zh-cn/docs/concepts/security/pod-security-standards/), 了解策略建议。 -- 阅读 [Pod 安全策略参考](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy), +- 阅读 [PodSecurityPolicy 参考](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy), 了解 API 细节。 diff --git a/content/zh-cn/docs/concepts/windows/intro.md b/content/zh-cn/docs/concepts/windows/intro.md index ce447d4657ee3..1ea44cfc3d9be 100644 --- a/content/zh-cn/docs/concepts/windows/intro.md +++ b/content/zh-cn/docs/concepts/windows/intro.md @@ -468,7 +468,7 @@ The following list documents differences between how Pod specifications work bet supported on Windows. --> * `terminationGracePeriodSeconds` - 这在 Windows 上的 Docker 中没有完全实现, - 请参考[GitHub issue](https://github.com/moby/moby/issues/25982)。 + 请参考 [GitHub issue](https://github.com/moby/moby/issues/25982)。 目前的行为是通过 CTRL_SHUTDOWN_EVENT 发送 ENTRYPOINT 进程,然后 Windows 默认等待 5 秒, 最后使用正常的 Windows 关机行为终止所有进程。 5 秒默认值实际上位于[容器内](https://github.com/moby/moby/issues/25982#issuecomment-426441183)的 Windows 注册表中, @@ -637,7 +637,7 @@ Windows Server SAC release -也适用 Kubernetes [版本偏差策略](/zh-cn/docs/setup/release/version-skew-policy/)。 +也适用 Kubernetes [版本偏差策略](/zh-cn/releases/version-skew-policy/)。 ### Pod 选择算符 {#pod-selector} -`.spec.selector` 字段是一个[标签选择算符](/zh-cn/docs/concepts/overview/working-with-objects/labels/#label-selectors)。 +`.spec.selector` 字段是一个[标签选择算符](/zh-cn/docs/concepts/overview/working-with-objects/labels/#label-selectors)。 ReplicationController 管理标签与选择算符匹配的所有 Pod。 它不区分它创建或删除的 Pod 和其他人或进程创建或删除的 Pod。 这允许在不影响正在运行的 Pod 的情况下替换 ReplicationController。 @@ -299,7 +299,7 @@ If you do not specify `.spec.replicas`, then it defaults to 1. 你可以通过设置 `.spec.replicas` 来指定应该同时运行多少个 Pod。 在任何时候,处于运行状态的 Pod 个数都可能高于或者低于设定值。例如,副本个数刚刚被增加或减少时,或者一个 Pod 处于优雅终止过程中而其替代副本已经提前开始创建时。 -如果你没有指定 `.spec.replicas` ,那么它默认是 1。 +如果你没有指定 `.spec.replicas`,那么它默认是 1。 -## 使用 StatefulSets +## 使用 StatefulSets {#using-statefulsets} StatefulSets 对于需要满足以下一个或多个需求的应用程序很有价值: @@ -164,7 +164,7 @@ The name of a StatefulSet object must be a valid * `volumeClaimTemplates` 将通过 PersistentVolumes 驱动提供的 [PersistentVolumes](/zh-cn/docs/concepts/storage/persistent-volumes/) 来提供稳定的存储。 -StatefulSet 的命名需要遵循[DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)规范。 +StatefulSet 的命名需要遵循 [DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)规范。 -#### OrderedReady Pod 管理 +#### OrderedReady Pod 管理 {#orderedready-pod-management} `OrderedReady` Pod 管理是 StatefulSet 的默认设置。它实现了 [上面](#deployment-and-scaling-guarantees)描述的功能。 @@ -467,7 +467,7 @@ StatefulSet 的 `.spec.updateStrategy` 字段让 `RollingUpdate` : `RollingUpdate` 更新策略对 StatefulSet 中的 Pod 执行自动的滚动更新。这是默认的更新策略。 - + -### 最大不可用 Pod +### 最大不可用 Pod {#maximum-unavailable-pods} {{< feature-state for_k8s_version="v1.24" state="alpha" >}} @@ -529,7 +529,7 @@ The value can be an absolute number (for example, `5`) or a percentage of desire Pods (for example, `10%`). Absolute number is calculated from the percentage value by rounding it up. This field cannot be 0. The default setting is 1. --> -你可以通过指定 `.spec.updateStrategy.rollingUpdate.maxUnavailable` +你可以通过指定 `.spec.updateStrategy.rollingUpdate.maxUnavailable` 字段来控制更新期间不可用的 Pod 的最大数量。 该值可以是绝对值(例如,“5”)或者是期望 Pod 个数的百分比(例如,`10%`)。 绝对值是根据百分比值四舍五入计算的。 @@ -547,13 +547,13 @@ unavailable Pod in the range `0` to `replicas - 1`, it will be counted towards {{< note >}} The `maxUnavailable` field is in Alpha stage and it is honored only by API servers that are running with the `MaxUnavailableStatefulSet` -[feature gate](/docs/reference/commmand-line-tools-reference/feature-gates/) +[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) enabled. {{< /note >}} --> {{< note >}} `maxUnavailable` 字段处于 Alpha 阶段,仅当 API 服务器启用了 `MaxUnavailableStatefulSet` -[特性门控](/zh-cn/docs/reference/commmand-line-tools-reference/feature-gates/)时才起作用。 +[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)时才起作用。 {{< /note >}} -在 StatefulSet 的生命周期中,可选字段 +在 StatefulSet 的生命周期中,可选字段 `.spec.persistentVolumeClaimRetentionPolicy` 控制是否删除以及如何删除 PVC。 使用该字段,你必须启用 `StatefulSetAutoDeletePVC` [特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)。 启用后,你可以为每个 StatefulSet 配置两个策略: - -你所添加的 Pod 状况名称必须满足 Kubernetes +你所添加的 Pod 状况名称必须满足 Kubernetes [标签键名格式](/zh-cn/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set)。 -如果容器中的进程能够在遇到问题或不健康的情况下自行崩溃,则不一定需要存活态探针; -`kubelet` 将根据 Pod 的`restartPolicy` 自动执行修复操作。 +如果容器中的进程能够在遇到问题或不健康的情况下自行崩溃,则不一定需要存活态探针; +`kubelet` 将根据 Pod 的 `restartPolicy` 自动执行修复操作。 如果你希望容器在探测失败时被杀死并重新启动,那么请指定一个存活态探针, -并指定`restartPolicy` 为 "`Always`" 或 "`OnFailure`"。 +并指定 `restartPolicy` 为 "`Always`" 或 "`OnFailure`"。