You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh-cn/docs/tasks/run-application/force-delete-stateful-set-pod.md
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: 强制删除 StatefulSet 中的 Pods
2
+
title: 强制删除 StatefulSet 中的 Pod
3
3
content_type: task
4
4
weight: 70
5
5
---
@@ -20,7 +20,7 @@ weight: 70
20
20
This page shows how to delete Pods which are part of a {{< glossary_tooltip text="stateful set" term_id="StatefulSet" >}}, and explains the considerations to keep in mind when doing so.
这就是所谓的由 StatefulSet 提供的**最多一个(At Most One)** Pod 的语义。
48
48
49
49
<!--
50
50
Manual force deletion should be undertaken with caution, as it has the potential to violate the at most one semantics inherent to StatefulSet. StatefulSets may be used to run distributed and clustered applications which have a need for a stable network identity and stable storage. These applications often have configuration which relies on an ensemble of a fixed number of members with fixed identities. Having multiple members with the same identity can be disastrous and may lead to data loss (e.g. split brain scenario in quorum-based systems).
You can perform a graceful pod deletion with the following command:
61
61
-->
62
-
## 删除 Pods {#delete-pods}
62
+
## 删除 Pod {#delete-pods}
63
63
64
64
你可以使用下面的命令执行体面地删除 Pod:
65
65
@@ -68,15 +68,17 @@ kubectl delete pods <pod>
68
68
```
69
69
70
70
<!--
71
-
For the above to lead to graceful termination, the Pod **must not** specify a `pod.Spec.TerminationGracePeriodSeconds` of 0. The practice of setting a `pod.Spec.TerminationGracePeriodSeconds` of 0 seconds is unsafe and strongly discouraged for StatefulSet Pods. Graceful deletion is safe and will ensure that the [Pod shuts down gracefully](/docs/user-guide/pods/#termination-of-pods) before the kubelet deletes the name from the apiserver.
71
+
For the above to lead to graceful termination, the Pod **must not** specify a `pod.Spec.TerminationGracePeriodSeconds` of 0. The practice of setting a `pod.Spec.TerminationGracePeriodSeconds` of 0 seconds is unsafe and strongly discouraged for StatefulSet Pods. Graceful deletion is safe and will ensure that the Pod
72
+
[shuts down gracefully](/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
73
+
before the kubelet deletes the name from the apiserver.
@@ -103,7 +105,8 @@ The only ways in which a Pod in such a state can be removed from the apiserver a
103
105
<!--
104
106
The recommended best practice is to use the first or second approach. If a Node is confirmed to be dead (e.g. permanently disconnected from the network, powered down, etc), then delete the Node object. If the Node is suffering from a network partition, then try to resolve this or wait for it to resolve. When the partition heals, the kubelet will complete the deletion of the Pod and free up its name in the apiserver.
105
107
-->
106
-
推荐使用第一种或者第二种方法。如果确认节点已经不可用了 (比如,永久断开网络、断电等),
108
+
推荐使用第一种或者第二种方法。
109
+
如果确认节点已经不可用了(比如,永久断开网络、断电等),
107
110
则应删除 Node 对象。
108
111
如果节点遇到网裂问题,请尝试解决该问题或者等待其解决。
109
112
当网裂愈合时,kubelet 将完成 Pod 的删除并从 API 服务器上释放其名字。
@@ -163,7 +166,7 @@ kubectl patch pod <pod> -p '{"metadata":{"finalizers":null}}'
163
166
<!--
164
167
Always perform force deletion of StatefulSet Pods carefully and with complete knowledge of the risks involved.
0 commit comments