diff --git a/content/zh-cn/docs/concepts/workloads/controllers/cron-jobs.md b/content/zh-cn/docs/concepts/workloads/controllers/cron-jobs.md index dd122a4d4b..cc3afa0f29 100644 --- a/content/zh-cn/docs/concepts/workloads/controllers/cron-jobs.md +++ b/content/zh-cn/docs/concepts/workloads/controllers/cron-jobs.md @@ -110,7 +110,7 @@ The `.spec.schedule` field is required. The value of that field follows the [Cro # │ │ │ ┌───────────── month (1 - 12) # │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday) # │ │ │ │ │ OR sun, mon, tue, wed, thu, fri, sat -# │ │ │ │ │ +# │ │ │ │ │ # │ │ │ │ │ # * * * * * ``` @@ -384,21 +384,15 @@ Go 标准库中的时区数据库包含在二进制文件中,并用作备用 在 `.spec.schedule` 中通过 `CRON_TZ` 或 `TZ` 变量来指定时区**并未得到官方支持**(而且从未支持过)。 - - -从 Kubernetes 1.29 版本开始,如果你尝试设定包含 `TZ` 或 `CRON_TZ` 时区规范的排期表, -Kubernetes 将无法创建该资源,并会报告验证错误。 -对已经设置 `TZ` 或 `CRON_TZ` 的 CronJob 进行更新时, -系统会继续向客户端发送[警告](/zh-cn/blog/2020/09/03/warnings/)。 +如果你尝试设置一个包含 `TZ` 或 `CRON_TZ` 时区规范的计划,Kubernetes +将因验证错误无法创建或更新资源。 +你应该使用[时区字段](#time-zones)指定时区。 -Pod 的共享上下文包括一组 Linux 名字空间、控制组(cgroup)和可能一些其他的隔离方面, +Pod 的共享上下文包括一组 Linux 名字空间、控制组(CGroup)和可能一些其他的隔离方面, 即用来隔离{{< glossary_tooltip text="容器" term_id="container" >}}的技术。 在 Pod 的上下文中,每个独立的应用可能会进一步实施隔离。 @@ -419,9 +419,13 @@ Kubernetes 并不禁止你直接管理 Pod。对运行中的 Pod 的某些字段 - Pod 的绝大多数元数据都是不可变的。例如,你不可以改变其 `namespace`、`name`、 - `uid` 或者 `creationTimestamp` 字段;`generation` 字段是比较特别的, - 如果更新该字段,只能增加字段取值而不能减少。 + `uid` 或者 `creationTimestamp` 字段。 + - `generation` 字段是特别的。它将由系统自动设置,使得新 + Pod 的 `generation` 为 1,并且每次更新 Pod 规格中的可变字段时, + `generation` 将增加 1。如果设置了 Alpha 基本特性门控 PodObservedGenerationTracking, + 则 Pod 的 `status.observedGeneration` 将反映报告 Pod 状态时的 + Pod 的 `metadata.generation`。 - 如果 `metadata.deletionTimestamp` 已经被设置,则不可以向 `metadata.finalizers` 列表中添加新的条目。 - Pod 更新不可以改变除 `spec.containers[*].image`、`spec.initContainers[*].image`、 @@ -447,6 +455,38 @@ Kubernetes 并不禁止你直接管理 Pod。对运行中的 Pod 的某些字段 1. 如果该字段尚未设置,可以将其设置为一个正数; 1. 如果该字段已经设置为一个正数,可以将其设置为一个更小的、非负的整数。 + +### Pod 子资源 + +上述更新规则适用于常规的 Pod 更新,但其他 Pod 字段可以通过**子资源**进行更新。 + + +- **调整大小:** `resize` 子资源允许更新容器资源(`spec.containers[*].resources`)。 + 更多详情参见[调整容器资源大小](#resize-container-resources)。 +- **临时容器:** `ephemeralContainers` 子资源允许 + {{< glossary_tooltip text="临时容器" term_id="ephemeral-container" >}} + 被添加到一个 Pod 中。 + 更多详情参见[临时容器](/zh-cn/docs/concepts/workloads/pods/ephemeral-containers/)。 +- **状态:** `status` 子资源允许更新 Pod 状态。 + 这通常仅由 kubelet 和其他系统控制器使用。 +- **绑定:** `binding` 子资源允许通过 `Binding` 请求设置 Pod 的 `spec.nodeName`。 + 这通常仅由 {{< glossary_tooltip text="调度器" term_id="kube-scheduler" >}} 使用。 + * 放弃特定的 Linux 权能(Capability)以避免受到某 CVE 的影响。 -* 强制 Pod 中的所有进程以非 root 用户或特定用户或组 ID 的身份运行。 +* 强制 Pod 中的所有进程以非 Root 用户或特定用户或组 ID 的身份运行。 * 设置特定的 seccomp 配置文件。 * 设置 Windows 安全选项,例如容器是否作为 HostProcess 运行。 @@ -566,8 +606,10 @@ security context of the Pod spec. For details and instructions, see * To learn more about the Pod security context, see [Configure a Security Context for a Pod or Container](/docs/tasks/configure-pod-container/security-context/). --> -* 要了解可以使用的内核级安全约束,请参阅 [Pod 和容器的 Linux 内核安全约束](/zh-cn/docs/concepts/security/linux-kernel-security-constraints)。 -* 要了解有关 Pod 安全上下文的更多信息,请参阅[为 Pod 或容器配置安全上下文](/zh-cn/docs/tasks/configure-pod-container/security-context/)。 +* 要了解可以使用的内核级安全约束,请参阅 + [Pod 和容器的 Linux 内核安全约束](/zh-cn/docs/concepts/security/linux-kernel-security-constraints)。 +* 要了解有关 Pod 安全上下文的更多信息, + 请参阅[为 Pod 或容器配置安全上下文](/zh-cn/docs/tasks/configure-pod-container/security-context/)。 静态 Pod 通常绑定到某个节点上的 {{< glossary_tooltip text="kubelet" term_id="kubelet" >}}。 其主要用途是运行自托管的控制面。 @@ -656,7 +699,7 @@ Pods in a Kubernetes cluster are used in two main ways: --> Kubernetes 集群中的 Pod 主要有两种用法: -* **运行单个容器的 Pod**。"每个 Pod 一个容器" 模型是最常见的 Kubernetes 用例; +* **运行单个容器的 Pod**。"每个 Pod 一个容器"模型是最常见的 Kubernetes 用例; 在这种情况下,可以将 Pod 看作单个容器的包装器。Kubernetes 直接管理 Pod,而不是容器。 * **运行多个需要协同工作的容器的 Pod**。 Pod 可以封装由多个紧密耦合且需要共享资源的并置容器组成的应用。 @@ -693,7 +736,7 @@ that provide auxiliary services to the main application Pod (for example: a serv [边车容器](/zh-cn/docs/concepts/workloads/pods/sidecar-containers/)(例如:服务网格)。 -{{< feature-state for_k8s_version="v1.29" state="beta" >}} +{{< feature-state feature_gate_name="SidecarContainers" >}} 要了解为什么 Kubernetes 会在其他资源 (如 {{< glossary_tooltip text="StatefulSet" term_id="statefulset" >}}