1
1
---
2
- title : 确保 PodDisruptionBudget 的前提下安全地清空一个节点
2
+ title : 安全地清空一个节点
3
3
content_type : task
4
+ min-kubernetes-server-version : 1.5
5
+ ---
6
+ <!--
4
7
---
5
- <!--
6
8
reviewers:
7
9
- davidopp
8
10
- mml
9
11
- foxish
10
12
- kow3ns
11
- title: Safely Drain a Node while Respecting the PodDisruptionBudget
13
+ title: Safely Drain a Node
12
14
content_type: task
15
+ min-kubernetes-server-version: 1.5
16
+ ---
13
17
-->
14
18
15
19
<!-- overview -->
16
20
<!--
17
21
This page shows how to safely drain a node, respecting the PodDisruptionBudget you have defined.
18
22
-->
19
- 本页展示了如何在确保 PodDisruptionBudget 的前提下,安全地清空一个
20
- {{< glossary_tooltip text="节点" term_id="node" >}}。
23
+ 本页展示了如何在确保 PodDisruptionBudget 的前提下,安全地清空一个{{< glossary_tooltip text="节点" term_id="node" >}}。
21
24
22
25
## {{% heading "prerequisites" %}}
23
26
24
27
{{% version-check %}}
25
-
26
28
<!--
27
29
This task assumes that you have met the following prerequisites:
28
30
29
31
* You are using Kubernetes release >= 1.5.
30
32
* Either:
31
33
1. You do not require your applications to be highly available during the
32
34
node drain, or
33
- 1 . You have read about the [PodDisruptionBudget concept](/docs/concepts/workloads/pods/disruptions/)
35
+ 2 . You have read about the [PodDisruptionBudget concept](/docs/concepts/workloads/pods/disruptions/)
34
36
and [Configured PodDisruptionBudgets](/docs/tasks/run-application/configure-pdb/) for
35
37
applications that need them.
36
38
-->
37
- 此任务假设您已经满足以下先决条件 :
39
+ 此任务假定你已经满足了以下先决条件 :
38
40
39
41
* 使用的 Kubernetes 版本 >= 1.5。
40
42
* 以下两项,具备其一:
41
43
1 . 在节点清空期间,不要求应用程序具有高可用性
42
- 1 . 你已经了解了 [ PodDisruptionBudget 的概念] ( /zh/docs/concepts/workloads/pods/disruptions/ ) ,
44
+ 2 . 你已经了解了 [ PodDisruptionBudget 的概念] ( /zh/docs/concepts/workloads/pods/disruptions/ ) ,
43
45
并为需要它的应用程序[ 配置了 PodDisruptionBudget] ( /zh/docs/tasks/run-application/configure-pdb/ ) 。
44
46
45
47
<!-- steps -->
46
48
49
+ <!--
50
+ ## (Optional) Configure a disruption budget {#configure-poddisruptionbudget}
51
+
52
+ To endure that your workloads remain available during maintenance, you can
53
+ configure a [PodDisruptionBudget](/docs/concepts/workloads/pods/disruptions/).
54
+
55
+ If availability is important for any applications that run or could run on the node(s)
56
+ that you are draining, [configure a PodDisruptionBudgets](/docs/tasks/run-application/configure-pdb/)
57
+ first and the continue following this guide.
58
+ -->
59
+ ## (可选) 配置干扰预算 {#configure-poddisruptionbudget}
60
+
61
+ 为了确保你的负载在维护期间仍然可用,你可以配置一个 [ PodDisruptionBudget] ( /zh/docs/concepts/workloads/pods/disruptions/ ) 。
62
+ 如果可用性对于正在清空的该节点上运行或可能在该节点上运行的任何应用程序很重要,
63
+ 首先 [ 配置一个 PodDisruptionBudgets] ( /zh/docs/tasks/run-application/configure-pdb/ ) 并继续遵循本指南。
64
+
47
65
<!--
48
66
## Use `kubectl drain` to remove a node from service
49
67
@@ -176,8 +194,7 @@ itself. To attempt an eviction (perhaps more REST-precisely, to attempt to
176
194
[ Kubernetes 语言客户端] ( /zh/docs/tasks/administer-cluster/access-cluster-api/#programmatic-access-to-the-api ) 。
177
195
178
196
Pod 的 Eviction 子资源可以看作是一种策略控制的 DELETE 操作,作用于 Pod 本身。
179
- 要尝试驱逐(更准确地说,尝试 * 创建* 一个 Eviction),需要用 POST
180
- 发出所尝试的操作。这里有一个例子:
197
+ 要尝试驱逐(更准确地说,尝试 * 创建* 一个 Eviction),需要用 POST 发出所尝试的操作。这里有一个例子:
181
198
182
199
``` json
183
200
{
@@ -213,7 +230,7 @@ The API can respond in one of three ways:
213
230
- If there is some kind of misconfiguration, like multiple budgets pointing at
214
231
the same pod, you will get `500 Internal Server Error`.
215
232
-->
216
- API可以通过以下三种方式之一进行响应 :
233
+ API 可以通过以下三种方式之一进行响应 :
217
234
218
235
- 如果驱逐被授权,那么 Pod 将被删掉,并且你会收到 ` 200 OK ` ,
219
236
就像你向 Pod 的 URL 发送了 ` DELETE ` 请求一样。
@@ -229,7 +246,7 @@ For a given eviction request, there are two cases:
229
246
- There is no budget that matches this pod. In this case, the server always
230
247
returns `200 OK`.
231
248
- There is at least one budget. In this case, any of the three above responses may
232
- apply.
249
+ apply.
233
250
-->
234
251
对于一个给定的驱逐请求,有两种情况:
235
252
@@ -272,9 +289,12 @@ Kubernetes 并没有具体说明在这种情况下应该采取什么行为,
272
289
273
290
## {{% heading "whatsnext" %}}
274
291
292
+
275
293
<!--
276
294
* Follow steps to protect your application by [configuring a Pod Disruption Budget](/docs/tasks/run-application/configure-pdb/).
277
- -->
295
+ * Learn more about [maintenance on a node](/docs/tasks/administer-cluster/cluster-management/#maintenance-on-a-node).
296
+ -->
278
297
* 执行[ 配置 PDB] ( /zh/docs/tasks/run-application/configure-pdb/ ) 中的各个步骤,
279
298
保护你的应用
299
+ * 进一步了解[ 节点维护] ( /zh/docs/tasks/administer-cluster/cluster-management/#maintenance-on-a-node ) 。
280
300
0 commit comments