Skip to content

Commit e54a8fe

Browse files
authored
Merge pull request #36658 from astraw99/patch-5
Drop doc tab `prior to v1.20` about cascading deletion
2 parents 297d82a + bf9bce3 commit e54a8fe

File tree

2 files changed

+1
-343
lines changed

2 files changed

+1
-343
lines changed

content/en/docs/tasks/administer-cluster/use-cascading-deletion.md

Lines changed: 1 addition & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ to delete dependents of an object. You can switch to foreground cascading deleti
4747
using either `kubectl` or the Kubernetes API, depending on the Kubernetes
4848
version your cluster runs. {{<version-check>}}
4949

50-
{{<tabs name="foreground_deletion">}}
51-
{{% tab name="Kubernetes 1.20.x and later" %}}
50+
5251
You can delete objects using foreground cascading deletion using `kubectl` or the
5352
Kubernetes API.
5453

@@ -96,56 +95,13 @@ kubectl delete deployment nginx-deployment --cascade=foreground
9695
...
9796
```
9897

99-
{{% /tab %}}
100-
{{% tab name="Versions prior to Kubernetes 1.20.x" %}}
101-
You can delete objects using foreground cascading deletion by calling the
102-
Kubernetes API.
103-
104-
For details, read the [documentation for your Kubernetes version](/docs/home/supported-doc-versions/).
105-
106-
1. Start a local proxy session:
107-
108-
```shell
109-
kubectl proxy --port=8080
110-
```
111-
112-
1. Use `curl` to trigger deletion:
113-
114-
```shell
115-
curl -X DELETE localhost:8080/apis/apps/v1/namespaces/default/deployments/nginx-deployment \
116-
-d '{"kind":"DeleteOptions","apiVersion":"v1","propagationPolicy":"Foreground"}' \
117-
-H "Content-Type: application/json"
118-
```
119-
120-
The output contains a `foregroundDeletion` {{<glossary_tooltip text="finalizer" term_id="finalizer">}}
121-
like this:
122-
123-
```
124-
"kind": "Deployment",
125-
"apiVersion": "apps/v1",
126-
"metadata": {
127-
"name": "nginx-deployment",
128-
"namespace": "default",
129-
"uid": "d1ce1b02-cae8-4288-8a53-30e84d8fa505",
130-
"resourceVersion": "1363097",
131-
"creationTimestamp": "2021-07-08T20:24:37Z",
132-
"deletionTimestamp": "2021-07-08T20:27:39Z",
133-
"finalizers": [
134-
"foregroundDeletion"
135-
]
136-
...
137-
```
138-
{{% /tab %}}
139-
{{</tabs>}}
14098

14199
## Use background cascading deletion {#use-background-cascading-deletion}
142100

143101
1. [Create a sample Deployment](/docs/tasks/run-application/run-stateless-application-deployment/#creating-and-exploring-an-nginx-deployment).
144102
1. Use either `kubectl` or the Kubernetes API to delete the Deployment,
145103
depending on the Kubernetes version your cluster runs. {{<version-check>}}
146104

147-
{{<tabs name="background_deletion">}}
148-
{{% tab name="Kubernetes version 1.20.x and later" %}}
149105

150106
You can delete objects using background cascading deletion using `kubectl`
151107
or the Kubernetes API.
@@ -192,54 +148,6 @@ kubectl delete deployment nginx-deployment --cascade=background
192148
"uid": "cc9eefb9-2d49-4445-b1c1-d261c9396456"
193149
}
194150
```
195-
{{% /tab %}}
196-
{{% tab name="Versions prior to Kubernetes 1.20.x" %}}
197-
Kubernetes uses background cascading deletion by default, and does so
198-
even if you run the following commands without the `--cascade` flag or the
199-
`propagationPolicy: Background` argument.
200-
201-
For details, read the [documentation for your Kubernetes version](/docs/home/supported-doc-versions/).
202-
203-
**Using kubectl**
204-
205-
Run the following command:
206-
207-
```shell
208-
kubectl delete deployment nginx-deployment --cascade=true
209-
```
210-
211-
**Using the Kubernetes API**
212-
213-
1. Start a local proxy session:
214-
215-
```shell
216-
kubectl proxy --port=8080
217-
```
218-
219-
1. Use `curl` to trigger deletion:
220-
221-
```shell
222-
curl -X DELETE localhost:8080/apis/apps/v1/namespaces/default/deployments/nginx-deployment \
223-
-d '{"kind":"DeleteOptions","apiVersion":"v1","propagationPolicy":"Background"}' \
224-
-H "Content-Type: application/json"
225-
```
226-
227-
The output is similar to this:
228-
229-
```
230-
"kind": "Status",
231-
"apiVersion": "v1",
232-
...
233-
"status": "Success",
234-
"details": {
235-
"name": "nginx-deployment",
236-
"group": "apps",
237-
"kind": "deployments",
238-
"uid": "cc9eefb9-2d49-4445-b1c1-d261c9396456"
239-
}
240-
```
241-
{{% /tab %}}
242-
{{</tabs>}}
243151

244152

245153
## Delete owner objects and orphan dependents {#set-orphan-deletion-policy}
@@ -250,8 +158,6 @@ dependent objects. You can make Kubernetes *orphan* these dependents using
250158
`kubectl` or the Kubernetes API, depending on the Kubernetes version your
251159
cluster runs. {{<version-check>}}
252160

253-
{{<tabs name="orphan_objects">}}
254-
{{% tab name="Kubernetes version 1.20.x and later" %}}
255161

256162
**Using kubectl**
257163

@@ -293,52 +199,6 @@ kubectl delete deployment nginx-deployment --cascade=orphan
293199
...
294200
```
295201

296-
{{% /tab %}}
297-
{{% tab name="Versions prior to Kubernetes 1.20.x" %}}
298-
299-
For details, read the [documentation for your Kubernetes version](/docs/home/supported-doc-versions/).
300-
301-
**Using kubectl**
302-
303-
Run the following command:
304-
305-
```shell
306-
kubectl delete deployment nginx-deployment --cascade=orphan
307-
```
308-
309-
**Using the Kubernetes API**
310-
311-
1. Start a local proxy session:
312-
313-
```shell
314-
kubectl proxy --port=8080
315-
```
316-
317-
1. Use `curl` to trigger deletion:
318-
319-
```shell
320-
curl -X DELETE localhost:8080/apis/apps/v1/namespaces/default/deployments/nginx-deployment \
321-
-d '{"kind":"DeleteOptions","apiVersion":"v1","propagationPolicy":"Orphan"}' \
322-
-H "Content-Type: application/json"
323-
```
324-
325-
The output contains `orphan` in the `finalizers` field, similar to this:
326-
327-
```
328-
"kind": "Deployment",
329-
"apiVersion": "apps/v1",
330-
"namespace": "default",
331-
"uid": "6f577034-42a0-479d-be21-78018c466f1f",
332-
"creationTimestamp": "2021-07-09T16:46:37Z",
333-
"deletionTimestamp": "2021-07-09T16:47:08Z",
334-
"deletionGracePeriodSeconds": 0,
335-
"finalizers": [
336-
"orphan"
337-
],
338-
...
339-
```
340-
{{% /tab %}}
341-
{{</tabs>}}
342202

343203
You can check that the Pods managed by the Deployment are still running:
344204

0 commit comments

Comments
 (0)