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/configure-pdb.md
+39-28Lines changed: 39 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,9 @@ selector goes into the PDBs `.spec.selector`.
84
84
`.spec.selector` 字段中加入同样的选择算符。
85
85
86
86
<!--
87
-
From version 1.15 PDBs support custom controllers where the [scale subresource](/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#scale-subresource) is enabled.
87
+
From version 1.15 PDBs support custom controllers where the
Copy file name to clipboardExpand all lines: content/zh-cn/docs/tasks/run-application/delete-stateful-set.md
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,8 @@ This task shows you how to delete a {{< glossary_tooltip term_id="StatefulSet" >
34
34
<!--
35
35
## Deleting a StatefulSet
36
36
37
-
You can delete a StatefulSet in the same way you delete other resources in Kubernetes: use the `kubectl delete` command, and specify the StatefulSet either by file or by name.
37
+
You can delete a StatefulSet in the same way you delete other resources in Kubernetes:
38
+
use the `kubectl delete` command, and specify the StatefulSet either by file or by name.
38
39
-->
39
40
## 删除 StatefulSet {#deleting-a-statefulset}
40
41
@@ -68,8 +69,9 @@ kubectl delete service <服务名称>
68
69
```
69
70
70
71
<!--
71
-
When deleting a StatefulSet through `kubectl`, the StatefulSet scales down to 0. All Pods that are part of this workload are also deleted. If you want to delete only the StatefulSet and not the Pods, use `--cascade=orphan`.
72
-
For example:
72
+
When deleting a StatefulSet through `kubectl`, the StatefulSet scales down to 0.
73
+
All Pods that are part of this workload are also deleted. If you want to delete
74
+
only the StatefulSet and not the Pods, use `--cascade=orphan`. For example:
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:
85
+
By passing `--cascade=orphan` to `kubectl delete`, the Pods managed by the StatefulSet
86
+
are left behind even after the StatefulSet object itself is deleted. If the pods have
87
+
a label `app.kubernetes.io/name=MyApp`, you can then delete them as follows:
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.
100
+
Deleting the Pods in a StatefulSet will not delete the associated volumes.
101
+
This is to ensure that you have the chance to copy data off the volume before
102
+
deleting it. Deleting the PVC after the pods have terminated might trigger
103
+
deletion of the backing Persistent Volumes depending on the storage class
104
+
and reclaim policy. You should never assume ability to access a volume
105
+
after claim deletion.
97
106
-->
98
107
### 持久卷 {#persistent-volumes}
99
108
@@ -111,7 +120,8 @@ Use caution when deleting a PVC, as it may lead to data loss.
111
120
<!--
112
121
### Complete deletion of a StatefulSet
113
122
114
-
To delete everything in a StatefulSet, including the associated pods, you can run a series of commands similar to the following:
123
+
To delete everything in a StatefulSet, including the associated pods,
124
+
you can run a series of commands similar to the following:
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.
147
+
If you find that some pods in your StatefulSet are stuck in the 'Terminating'
148
+
or 'Unknown' states for an extended period of time, you may need to manually
149
+
intervene to forcefully delete the pods from the apiserver.
@@ -29,7 +30,9 @@ This task shows how to scale a StatefulSet. Scaling a StatefulSet refers to incr
29
30
- StatefulSets are only available in Kubernetes version 1.5 or later.
30
31
To check your version of Kubernetes, run `kubectl version`.
31
32
32
-
- Not all stateful applications scale nicely. If you are unsure about whether to scale your StatefulSets, see [StatefulSet concepts](/docs/concepts/workloads/controllers/statefulset/) or [StatefulSet tutorial](/docs/tutorials/stateful-application/basic-stateful-set/) for further information.
33
+
- Not all stateful applications scale nicely. If you are unsure about whether
34
+
to scale your StatefulSets, see [StatefulSet concepts](/docs/concepts/workloads/controllers/statefulset/)
35
+
or [StatefulSet tutorial](/docs/tutorials/stateful-application/basic-stateful-set/) for further information.
33
36
34
37
- You should perform scaling only when you are confident that your stateful application
Alternatively, you can do [in-place updates](/docs/concepts/cluster-administration/manage-deployment/#in-place-updates-of-resources) on your StatefulSets.
You cannot scale down a StatefulSet when any of the stateful Pods it manages is unhealthy. Scaling down only takes place
141
-
after those stateful Pods become running and ready.
145
+
You cannot scale down a StatefulSet when any of the stateful Pods it manages is
146
+
unhealthy. Scaling down only takes place after those stateful Pods become running and ready.
142
147
143
-
If spec.replicas > 1, Kubernetes cannot determine the reason for an unhealthy Pod. It might be the result of a permanent fault or of a transient fault. A transient fault can be caused by a restart required by upgrading or maintenance.
148
+
If spec.replicas > 1, Kubernetes cannot determine the reason for an unhealthy Pod.
149
+
It might be the result of a permanent fault or of a transient fault. A transient
150
+
fault can be caused by a restart required by upgrading or maintenance.
144
151
-->
145
152
当 Stateful 所管理的任何 Pod 不健康时,你不能对该 StatefulSet 执行缩容操作。
0 commit comments