From d6ad8266b03bceeb26936fc642b1a6ca80a07e71 Mon Sep 17 00:00:00 2001 From: howieyuen Date: Mon, 18 Jan 2021 11:05:52 +0800 Subject: [PATCH] sync content/zh/docs/concepts/architecture/nodes.md --- .../zh/docs/concepts/architecture/nodes.md | 58 ++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/content/zh/docs/concepts/architecture/nodes.md b/content/zh/docs/concepts/architecture/nodes.md index 490599289d..676f6f64b9 100644 --- a/content/zh/docs/concepts/architecture/nodes.md +++ b/content/zh/docs/concepts/architecture/nodes.md @@ -170,7 +170,7 @@ When you want to create Node objects manually, set the kubelet flag `--register- You can modify Node objects regardless of the setting of `--register-node`. For example, you can set labels on an existing Node, or mark it unschedulable. --> -#### 手动节点管理 +### 手动节点管理 你可以使用 {{< glossary_tooltip text="kubectl" term_id="kubectl" >}} 来创建和修改 Node 对象。 @@ -283,6 +283,7 @@ The `conditions` field describes the status of all `Running` nodes. Examples of | `MemoryPressure` | `True` if pressure exists on the node memory - that is, if the node memory is low; otherwise `False` | | `PIDPressure` | `True` if pressure exists on the processes - that is, if there are too many processes on the node; otherwise `False` | | `NetworkUnavailable` | `True` if the network for the node is not correctly configured, otherwise `False` | +{{< /table >}} --> {{< table caption = "节点状况及每种状况适用场景的描述" >}} | 节点状况 | 描述 | @@ -292,6 +293,7 @@ The `conditions` field describes the status of all `Running` nodes. Examples of | `MemoryPressure` | `True` 表示节点存在内存压力,即节点内存可用量低,否则为 `False` | | `PIDPressure` | `True` 表示节点存在进程压力,即节点上进程过多;否则为 `False` | | `NetworkUnavailable` | `True` 表示节点网络配置不正确;否则为 `False` | +{{< /table >}} +## 节点体面关闭 {#graceful-node-shutdown} + +{{< feature-state state="alpha" for_k8s_version="v1.20" >}} + + +如果你启用了 `GracefulNodeShutdown` [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/), +那么 kubelet 尝试检测节点的系统关闭事件并终止在节点上运行的 Pod。 +在节点终止期间,kubelet 保证 Pod 遵从常规的 [Pod 终止流程](/zh/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)。 + + +当启用了 `GracefulNodeShutdown` 特性门控时, +kubelet 使用 [systemd 抑制器锁](https://www.freedesktop.org/wiki/Software/systemd/inhibit/) +在给定的期限内延迟节点关闭。在关闭过程中,kubelet 分两个阶段终止 Pod: + + +1. 终止在节点上运行的常规 Pod。 +2. 终止在节点上运行的[关键 Pod](/zh/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)。 + + +节点体面关闭的特性对应两个 [`KubeletConfiguration`](/zh/docs/tasks/administer-cluster/kubelet-config-file/) 选项: +* `ShutdownGracePeriod`: + * 指定节点应延迟关闭的总持续时间。此时间是 Pod 体面终止的时间总和,不区分常规 Pod 还是 + [关键 Pod](/zh/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)。 +* `ShutdownGracePeriodCriticalPods`: + * 在节点关闭期间指定用于终止 + [关键 Pod](/zh/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical) + 的持续时间。该值应小于 `ShutdownGracePeriod`。 + + +例如,如果设置了 `ShutdownGracePeriod=30s` 和 `ShutdownGracePeriodCriticalPods=10s`,则 kubelet 将延迟 30 秒关闭节点。 +在关闭期间,将保留前 20(30 - 10)秒用于体面终止常规 Pod,而保留最后 10 秒用于终止 +[关键 Pod](/zh/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical)。 + ## {{% heading "whatsnext" %}}