[zh-cn] update delete-stateful-set.md

pull/38752/head
zhuzhenghao 2023-01-04 12:16:59 +08:00
parent 0fa3f677ec
commit ae4cc75173
1 changed files with 9 additions and 10 deletions

View File

@ -19,9 +19,9 @@ weight: 60
<!-- overview -->
<!--
This task shows you how to delete a StatefulSet.
This task shows you how to delete a {{< glossary_tooltip term_id="StatefulSet" >}}.
-->
本任务展示如何删除 StatefulSet。
本任务展示如何删除 {{< glossary_tooltip text="StatefulSet" term_id="StatefulSet" >}}
## {{% heading "prerequisites" %}}
@ -92,13 +92,12 @@ kubectl delete pods -l app.kubernetes.io/name=MyApp
<!--
### Persistent Volumes
Deleting the Pods in a StatefulSet will not delete the associated volumes. This is to ensure that you have the chance to copy data off the volume before deleting it. Deleting the PVC after the pods have left the [terminating state](/docs/concepts/workloads/pods/pod/#termination-of-pods) might trigger deletion of the backing Persistent Volumes depending on the storage class and reclaim policy. You should never assume ability to access a volume after claim deletion.
Deleting the Pods in a StatefulSet will not delete the associated volumes. This is to ensure that you have the chance to copy data off the volume before deleting it. Deleting the PVC after the pods have terminated might trigger deletion of the backing Persistent Volumes depending on the storage class and reclaim policy. You should never assume ability to access a volume after claim deletion.
-->
### 持久卷 {#persistent-volumes}
删除 StatefulSet 管理的 Pod 并不会删除关联的卷。这是为了确保你有机会在删除卷之前从卷中复制数据。
在 Pod 离开[终止状态](/zh-cn/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination)
后删除 PVC 可能会触发删除背后的 PV 持久卷,具体取决于存储类和回收策略。
在 Pod 已经终止后删除 PVC 可能会触发删除背后的 PV 持久卷,具体取决于存储类和回收策略。
永远不要假定在 PVC 删除后仍然能够访问卷。
<!--
@ -111,11 +110,11 @@ Use caution when deleting a PVC, as it may lead to data loss.
<!--
### Complete deletion of a StatefulSet
To simply delete everything in a StatefulSet, including the associated pods, you can run a series of commands similar to the following:
To delete everything in a StatefulSet, including the associated pods, you can run a series of commands similar to the following:
-->
### 完全删除 StatefulSet {#complete-deletion-of-a-statefulset}
要删除 StatefulSet 中的所有内容,包括关联的 pods,你可以运行
要删除 StatefulSet 中的所有内容,包括关联的 Pod,你可以运行
一系列如下所示的命令:
```shell
@ -133,20 +132,20 @@ In the example above, the Pods have the label `app.kubernetes.io/name=MyApp`; su
<!--
### Force deletion of StatefulSet pods
If you find that some pods in your StatefulSet are stuck in the 'Terminating' or 'Unknown' states for an extended period of time, you may need to manually intervene to forcefully delete the pods from the apiserver. This is a potentially dangerous task. Refer to [Deleting StatefulSet Pods](/docs/tasks/manage-stateful-set/delete-pods/) for details.
If you find that some pods in your StatefulSet are stuck in the 'Terminating' or 'Unknown' states for an extended period of time, you may need to manually intervene to forcefully delete the pods from the apiserver. This is a potentially dangerous task. Refer to [Force Delete StatefulSet Pods](/docs/tasks/run-application/force-delete-stateful-set-pod/) for details.
-->
### 强制删除 StatefulSet 的 Pod
如果你发现 StatefulSet 的某些 Pod 长时间处于 'Terminating' 或者 'Unknown' 状态,
则可能需要手动干预以强制从 API 服务器中删除这些 Pod。
这是一项有点危险的任务。详细信息请阅读
[删除 StatefulSet 类型的 Pods](/zh-cn/docs/tasks/run-application/force-delete-stateful-set-pod/)。
[强制删除 StatefulSet 的 Pod](/zh-cn/docs/tasks/run-application/force-delete-stateful-set-pod/)。
## {{% heading "whatsnext" %}}
<!--
Learn more about [force deleting StatefulSet Pods](/docs/tasks/run-application/force-delete-stateful-set-pod/).
-->
进一步了解[强制删除 StatefulSet 的 Pods](/zh-cn/docs/tasks/run-application/force-delete-stateful-set-pod/)。
进一步了解[强制删除 StatefulSet 的 Pod](/zh-cn/docs/tasks/run-application/force-delete-stateful-set-pod/)。