Skip to content

Commit 536a524

Browse files
authored
Merge pull request #35327 from kinzhi/kinzhi177
[zh-cn]Update content/zh-cn/docs/tasks/run-application/delete-stateful-set.md
2 parents 0e59c62 + 136a8b2 commit 536a524

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

content/zh-cn/docs/tasks/run-application/delete-stateful-set.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ kubectl delete -f <file.yaml> --cascade=orphan
7878
```
7979

8080
<!--
81-
By passing `--cascade=orphan` to `kubectl delete`, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label `app=myapp`, you can then delete them as follows:
81+
By passing `--cascade=orphan` to `kubectl delete`, the Pods managed by the StatefulSet are left behind even after the StatefulSet object itself is deleted. If the pods have a label `app.kubernetes.io/name=MyApp`, you can then delete them as follows:
8282
--->
8383
通过将 `--cascade=orphan` 传递给 `kubectl delete`,在删除 StatefulSet 对象之后,
84-
StatefulSet 管理的 Pod 会被保留下来。如果 Pod 具有标签 `app=myapp`,则可以按照
84+
StatefulSet 管理的 Pod 会被保留下来。如果 Pod 具有标签 `app.kubernetes.io/name=MyApp`,则可以按照
8585
如下方式删除它们:
8686

8787
```shell
88-
kubectl delete pods -l app=myapp
88+
kubectl delete pods -l app.kubernetes.io/name=MyApp
8989
```
9090

9191

@@ -120,15 +120,15 @@ To simply delete everything in a StatefulSet, including the associated pods, you
120120

121121
```shell
122122
grace=$(kubectl get pods <stateful-set-pod> --template '{{.spec.terminationGracePeriodSeconds}}')
123-
kubectl delete statefulset -l app=myapp
123+
kubectl delete statefulset -l app.kubernetes.io/name=MyApp
124124
sleep $grace
125-
kubectl delete pvc -l app=myapp
125+
kubectl delete pvc -l app.kubernetes.io/name=MyApp
126126
```
127127

128128
<!--
129-
In the example above, the Pods have the label `app=myapp`; substitute your own label as appropriate.
129+
In the example above, the Pods have the label `app.kubernetes.io/name=MyApp`; substitute your own label as appropriate.
130130
-->
131-
在上面的例子中,Pod 的标签为 `app=myapp`;适当地替换你自己的标签。
131+
在上面的例子中,Pod 的标签为 `app.kubernetes.io/name=MyApp`;适当地替换你自己的标签。
132132

133133
<!--
134134
### Force deletion of StatefulSet pods

0 commit comments

Comments
 (0)