@@ -3,7 +3,6 @@ title: 强制删除 StatefulSet 中的 Pod
33content_type : task
44weight : 70
55---
6-
76<!--
87reviewers:
98- bprashanth
@@ -16,23 +15,24 @@ weight: 70
1615-->
1716
1817<!-- overview -->
18+
1919<!--
2020This page shows how to delete Pods which are part of a
2121{{< glossary_tooltip text="stateful set" term_id="StatefulSet" >}},
2222and explains the considerations to keep in mind when doing so.
2323-->
2424本文介绍如何删除 {{< glossary_tooltip text="StatefulSet" term_id="StatefulSet" >}}
25- 管理的 Pod,并解释这样操作时需要记住的注意事项 。
25+ 管理的 Pod,并解释这样操作时需要记住的一些注意事项 。
2626
2727## {{% heading "prerequisites" %}}
2828
2929<!--
30- * This is a fairly advanced task and has the potential to violate some of the properties
30+ - This is a fairly advanced task and has the potential to violate some of the properties
3131 inherent to StatefulSet.
32- * Before proceeding, make yourself familiar with the considerations enumerated below.
32+ - Before proceeding, make yourself familiar with the considerations enumerated below.
3333-->
34- * 这是一项相当高级的任务,并且可能会违反 StatefulSet 固有的某些属性。
35- * 继续任务之前,请熟悉下面列举的注意事项 。
34+ - 这是一项相当高级的任务,并且可能会违反 StatefulSet 固有的某些属性。
35+ - 请先熟悉下面列举的注意事项再开始操作 。
3636
3737<!-- steps -->
3838
@@ -46,11 +46,11 @@ number of Pods from ordinal 0 through N-1 are alive and ready. StatefulSet ensur
4646there is at most one Pod with a given identity running in a cluster. This is referred to as
4747*at most one* semantics provided by a StatefulSet.
4848-->
49- ## StatefulSet 注意事项
49+ ## StatefulSet 注意事项 {#statefulset-considerations}
5050
51- 在 StatefulSet 的正常操作中 ,** 永远不** 需要强制删除 StatefulSet 管理的 Pod。
51+ 在正常操作 StatefulSet 时 ,** 永远不** 需要强制删除 StatefulSet 管理的 Pod。
5252[ StatefulSet 控制器] ( /zh-cn/docs/concepts/workloads/controllers/statefulset/ ) 负责创建、
53- 扩缩和删除 StatefulSet 管理的 Pod。它尝试确保指定数量的从序数 0 到 N-1 的 Pod
53+ 扩缩和删除 StatefulSet 管理的 Pod。此控制器尽力确保指定数量的从序数 0 到 N-1 的 Pod
5454处于活跃状态并准备就绪。StatefulSet 确保在任何时候,集群中最多只有一个具有给定标识的 Pod。
5555这就是所谓的由 StatefulSet 提供的** 最多一个(At Most One)** Pod 的语义。
5656
@@ -63,9 +63,9 @@ members with fixed identities. Having multiple members with the same identity ca
6363and may lead to data loss (e.g. split brain scenario in quorum-based systems).
6464-->
6565应谨慎进行手动强制删除操作,因为它可能会违反 StatefulSet 固有的至多一个的语义。
66- StatefulSets 可用于运行分布式和集群级的应用,这些应用需要稳定的网络标识和可靠的存储。
66+ StatefulSet 可用于运行分布式和集群级的应用,这些应用需要稳定的网络标识和可靠的存储。
6767这些应用通常配置为具有固定标识固定数量的成员集合。
68- 具有相同身份的多个成员可能是灾难性的,并且可能导致数据丢失 (例如:票选系统中的脑裂场景 )。
68+ 具有相同身份的多个成员可能是灾难性的,并且可能导致数据丢失 (例如票选系统中的脑裂场景 )。
6969
7070<!--
7171## Delete Pods
@@ -101,24 +101,23 @@ Pods may also enter these states when the user attempts graceful deletion of a P
101101on an unreachable Node.
102102The only ways in which a Pod in such a state can be removed from the apiserver are as follows:
103103-->
104- 当某个节点不可达时,不会引发自动删除 Pod。
105- 在无法访问的节点上运行的 Pod 在
106- [ 超时] ( /zh-cn/docs/concepts/architecture/nodes/#condition )
107- 后会进入 “Terminating” 或者 “Unknown” 状态。
104+ 当某个节点不可达时,不会引发自动删除 Pod。在无法访问的节点上运行的 Pod
105+ 在[ 超时] ( /zh-cn/docs/concepts/architecture/nodes/#condition ) 后会进入
106+ “Terminating” 或者 “Unknown” 状态。
108107当用户尝试体面地删除无法访问的节点上的 Pod 时 Pod 也可能会进入这些状态。
109108从 API 服务器上删除处于这些状态 Pod 的仅有可行方法如下:
110109
111110<!--
112- * The Node object is deleted (either by you, or by the
111+ - The Node object is deleted (either by you, or by the
113112 [Node Controller](/docs/concepts/architecture/nodes/#node-controller)).
114- * The kubelet on the unresponsive Node starts responding, kills the Pod and removes the entry
113+ - The kubelet on the unresponsive Node starts responding, kills the Pod and removes the entry
115114 from the apiserver.
116- * Force deletion of the Pod by the user.
115+ - Force deletion of the Pod by the user.
117116-->
118- * 删除 Node 对象(要么你来删除, 要么[ 节点控制器] ( /zh-cn/docs/concepts/architecture/nodes/#node-controller )
117+ - 删除 Node 对象(要么你来删除, 要么[ 节点控制器] ( /zh-cn/docs/concepts/architecture/nodes/#node-controller )
119118 来删除)
120- * 无响应节点上的 kubelet 开始响应,杀死 Pod 并从 API 服务器上移除 Pod 对象
121- * 用户强制删除 pod
119+ - 无响应节点上的 kubelet 开始响应,杀死 Pod 并从 API 服务器上移除 Pod 对象
120+ - 用户强制删除 Pod
122121
123122<!--
124123The recommended best practice is to use the first or second approach. If a Node is confirmed
@@ -155,8 +154,8 @@ will violate the at most one semantics that StatefulSet is designed to guarantee
155154强制删除** 不会** 等待来自 kubelet 对 Pod 已终止的确认消息。
156155无论强制删除是否成功杀死了 Pod,它都会立即从 API 服务器中释放该名字。
157156这将让 StatefulSet 控制器创建一个具有相同标识的替身 Pod;因而可能导致正在运行 Pod 的重复,
158- 并且如果所述 Pod 仍然可以与 StatefulSet 的成员通信,则将违反 StatefulSet 所要保证的
159- 最多一个的语义 。
157+ 并且如果所述 Pod 仍然可以与 StatefulSet 的成员通信,则将违反 StatefulSet
158+ 所要保证的最多一个的语义 。
160159
161160<!--
162161When you force delete a StatefulSet pod, you are asserting that the Pod in question will never
@@ -188,7 +187,7 @@ kubectl delete pods <pod> --grace-period=0
188187If even after these commands the pod is stuck on `Unknown` state, use the following command to
189188remove the pod from the cluster:
190189-->
191- 如果在这些命令后 Pod 仍处于 ` Unknown ` 状态,请使用以下命令从集群中删除 Pod:
190+ 如果在执行这些命令后 Pod 仍处于 ` Unknown ` 状态,请使用以下命令从集群中删除 Pod:
192191
193192``` shell
194193kubectl patch pod < pod> -p ' {"metadata":{"finalizers":null}}'
0 commit comments