Skip to content

Commit 11bb15d

Browse files
authored
Merge pull request #39018 from windsonsea/dranode
[zh] sync safely-drain-node.md
2 parents b6cf653 + d1ef105 commit 11bb15d

File tree

1 file changed

+24
-22
lines changed

1 file changed

+24
-22
lines changed

content/zh-cn/docs/tasks/administer-cluster/safely-drain-node.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ weight: 310
1919
<!-- overview -->
2020
<!--
2121
This page shows how to safely drain a node, respecting the PodDisruptionBudget you have defined.
22-
-->
23-
本页展示了如何在确保 PodDisruptionBudget 的前提下,安全地清空一个{{< glossary_tooltip text="节点" term_id="node" >}}。
22+
-->
23+
本页展示了如何在确保 PodDisruptionBudget 的前提下,
24+
安全地清空一个{{< glossary_tooltip text="节点" term_id="node" >}}。
2425

2526
## {{% heading "prerequisites" %}}
2627

@@ -56,9 +57,10 @@ If availability is important for any applications that run or could run on the n
5657
that you are draining, [configure a PodDisruptionBudgets](/docs/tasks/run-application/configure-pdb/)
5758
first and then continue following this guide.
5859
-->
59-
## (可选) 配置干扰预算 {#configure-poddisruptionbudget}
60+
## (可选)配置干扰预算 {#configure-poddisruptionbudget}
6061

61-
为了确保你的负载在维护期间仍然可用,你可以配置一个 [PodDisruptionBudget](/zh-cn/docs/concepts/workloads/pods/disruptions/)
62+
为了确保你的负载在维护期间仍然可用,你可以配置一个
63+
[PodDisruptionBudget](/zh-cn/docs/concepts/workloads/pods/disruptions/)
6264
如果可用性对于正在清空的该节点上运行或可能在该节点上运行的任何应用程序很重要,
6365
首先 [配置一个 PodDisruptionBudgets](/zh-cn/docs/tasks/run-application/configure-pdb/) 并继续遵循本指南。
6466

@@ -74,19 +76,18 @@ and will respect the `PodDisruptionBudgets` you have specified.
7476
## 使用 `kubectl drain` 从服务中删除一个节点 {#use-kubectl-drain-to-remove-a-node-from-service}
7577

7678
在对节点执行维护(例如内核升级、硬件维护等)之前,
77-
可以使用 `kubectl drain` 从节点安全地逐出所有 Pods。
78-
安全的驱逐过程允许 Pod 的容器
79-
[体面地终止](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
80-
并确保满足指定的 PodDisruptionBudgets。
79+
可以使用 `kubectl drain` 从节点安全地逐出所有 Pod。
80+
安全的驱逐过程允许 Pod 的容器[体面地终止](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
81+
并确保满足指定的 `PodDisruptionBudgets`
8182

83+
{{< note >}}
8284
<!--
8385
By default `kubectl drain` will ignore certain system pods on the node
8486
that cannot be killed; see
8587
the [kubectl drain](/docs/reference/generated/kubectl/kubectl-commands/#drain)
8688
documentation for more details.
8789
-->
88-
{{< note >}}
89-
默认情况下, `kubectl drain` 将忽略节点上不能杀死的特定系统 Pod;
90+
默认情况下,`kubectl drain` 将忽略节点上不能杀死的特定系统 Pod;
9091
有关更多细节,请参阅
9192
[kubectl drain](/docs/reference/generated/kubectl/kubectl-commands/#drain) 文档。
9293
{{< /note >}}
@@ -101,7 +102,7 @@ cloud platform, deleting its virtual machine.
101102
102103
First, identify the name of the node you wish to drain. You can list all of the nodes in your cluster with
103104
-->
104-
`kubectl drain` 的成功返回,表明所有的 Pods(除了上一段中描述的被排除的那些),
105+
`kubectl drain` 的成功返回,表明所有的 Pod(除了上一段中描述的被排除的那些),
105106
已经被安全地逐出(考虑到期望的终止宽限期和你定义的 PodDisruptionBudget)。
106107
然后就可以安全地关闭节点,
107108
比如关闭物理机器的电源,如果它运行在云平台上,则删除它的虚拟机。
@@ -118,7 +119,7 @@ Next, tell Kubernetes to drain the node:
118119
接下来,告诉 Kubernetes 清空节点:
119120

120121
```shell
121-
kubectl drain --ignore-daemonsets <node name>
122+
kubectl drain --ignore-daemonsets <节点名称>
122123
```
123124

124125
<!--
@@ -129,12 +130,12 @@ the DaemonSet controller (part of the control plane) immediately replaces missin
129130
new equivalent Pods. The DaemonSet controller also creates Pods that ignore unschedulable
130131
taints, which allows the new Pods to launch onto a node that you are draining.
131132
-->
132-
如果存在由 DaemonSet 管理的 Pod,你需要使用 `kubectl` 指定 `--ignore-daemonsets` 才能成功腾空节点
133-
`kubectl drain` 子命令本身并不会实际腾空节点上的 DaemonSet Pod:
134-
DaemonSet 控制器(控制平面的一部分)立即创建新的等效 Pod 替换丢失的 Pod。
135-
DaemonSet 控制器还会创建忽略不可调度污点的 Pod,这允许新的 Pod 启动到你正在腾空的节点上
133+
如果存在 DaemonSet 管理的 Pod,你将需要为 `kubectl` 设置 `--ignore-daemonsets` 以成功地清空节点
134+
`kubectl drain` 子命令自身实际上不清空节点上的 DaemonSet Pod 集合
135+
DaemonSet 控制器(作为控制平面的一部分)会立即用新的等效 Pod 替换缺少的 Pod。
136+
DaemonSet 控制器还会创建忽略不可调度污点的 Pod,这种污点允许在你正在清空的节点上启动新的 Pod。
136137

137-
<!--
138+
<!--
138139
Once it returns (without giving an error), you can power down the node
139140
(or equivalently, if on a cloud platform, delete the virtual machine backing the node).
140141
If you leave the node in the cluster during the maintenance operation, you need to run
@@ -149,7 +150,7 @@ kubectl uncordon <node name>
149150
<!--
150151
afterwards to tell Kubernetes that it can resume scheduling new pods onto the node.
151152
-->
152-
然后告诉 Kubernetes,它可以继续在此节点上调度新的 Pods
153+
然后告诉 Kubernetes,它可以继续在此节点上调度新的 Pod
153154

154155
<!--
155156
## Draining multiple nodes in parallel
@@ -164,7 +165,7 @@ respect the `PodDisruptionBudget` you specify.
164165

165166
`kubectl drain` 命令一次只能发送给一个节点。
166167
但是,你可以在不同的终端或后台为不同的节点并行地运行多个 `kubectl drain` 命令。
167-
同时运行的多个 drain 命令仍然遵循你指定的 PodDisruptionBudget
168+
同时运行的多个 drain 命令仍然遵循你指定的 `PodDisruptionBudget`
168169

169170
<!--
170171
For example, if you have a StatefulSet with three replicas and have
@@ -196,9 +197,10 @@ eviction API.
196197
For more information, see [API-initiated eviction](/docs/concepts/scheduling-eviction/api-eviction/).
197198
-->
198199
## 驱逐 API {#the-eviction-api}
200+
199201
如果你不喜欢使用
200202
[kubectl drain](/docs/reference/generated/kubectl/kubectl-commands/#drain)
201-
(比如避免调用外部命令,或者更细化地控制 pod 驱逐过程),
203+
(比如避免调用外部命令,或者更细化地控制 Pod 驱逐过程),
202204
你也可以用驱逐 API 通过编程的方式达到驱逐的效果。
203205
更多信息,请参阅 [API 发起的驱逐](/zh-cn/docs/concepts/scheduling-eviction/api-eviction/)
204206

@@ -207,5 +209,5 @@ For more information, see [API-initiated eviction](/docs/concepts/scheduling-evi
207209
<!--
208210
* Follow steps to protect your application by [configuring a Pod Disruption Budget](/docs/tasks/run-application/configure-pdb/).
209211
-->
210-
* 执行[配置 PDB](/zh-cn/docs/tasks/run-application/configure-pdb/)中的各个步骤,
211-
保护你的应用
212+
* 执行[配置 PDB](/zh-cn/docs/tasks/run-application/configure-pdb/) 中的各个步骤,
213+
保护你的应用

0 commit comments

Comments
 (0)