|
2 | 2 | //
|
3 | 3 | // * applications/pruning-objects.adoc
|
4 | 4 |
|
| 5 | +:_content-type: PROCEDURE |
5 | 6 | [id="pruning-deployments_{context}"]
|
6 |
| -= Pruning DeploymentConfig objects |
| 7 | += Pruning deployment resources |
7 | 8 |
|
8 |
| -To prune `DeploymentConfig` objects that are no longer required by the system due to age and status, administrators can run the following command: |
| 9 | +You can prune resources associated with deployments that are no longer required by the system, due to age and status. |
| 10 | + |
| 11 | +The following command prunes replication controllers associated with `DeploymentConfig` objects: |
9 | 12 |
|
10 | 13 | [source,terminal]
|
11 | 14 | ----
|
12 | 15 | $ oc adm prune deployments [<options>]
|
13 | 16 | ----
|
14 | 17 |
|
15 |
| -.Prune deployments CLI configuration options |
16 |
| -[cols="4,8",options="header"] |
| 18 | +[NOTE] |
| 19 | +==== |
| 20 | +To also prune replica sets associated with `Deployment` objects, use the `--replica-sets` flag. This flag is currently a Technology Preview feature. |
| 21 | +==== |
| 22 | + |
| 23 | +.`oc adm prune deployments` flags |
| 24 | +[cols="4,8a",options="header"] |
17 | 25 | |===
|
18 | 26 |
|
19 | 27 | |Option |Description
|
20 | 28 |
|
21 | 29 | .^|`--confirm`
|
22 | 30 | |Indicate that pruning should occur, instead of performing a dry-run.
|
23 | 31 |
|
24 |
| -.^|`--orphans` |
25 |
| -|Prune all deployments that no longer have a `DeploymentConfig` object, has status of `Complete` or `Failed`, and has a replica count of zero. |
26 |
| - |
27 | 32 | .^|`--keep-complete=<N>`
|
28 |
| -|Per the `DeploymentConfig` object, keep the last `N` deployments that have a status of `Complete` and replica count of zero. (default `5`) |
| 33 | +|Per the `DeploymentConfig` object, keep the last `N` replication controllers that have a status of `Complete` and replica count of zero. The default is `5`. |
29 | 34 |
|
30 | 35 | .^|`--keep-failed=<N>`
|
31 |
| -|Per the `DeploymentConfig` object, keep the last `N` deployments that have a status of `Failed` and replica count of zero. (default `1`) |
| 36 | +|Per the `DeploymentConfig` object, keep the last `N` replication controllers that have a status of `Failed` and replica count of zero. The default is `1`. |
32 | 37 |
|
33 | 38 | .^|`--keep-younger-than=<duration>`
|
34 |
| -|Do not prune any object that is younger than `<duration>` relative to the current time. (default `60m`) Valid units of measurement include nanoseconds (`ns`), microseconds (`us`), milliseconds (`ms`), seconds (`s`), minutes (`m`), and hours (`h`). |
| 39 | +|Do not prune any replication controller that is younger than `<duration>` relative to the current time. Valid units of measurement include nanoseconds (`ns`), microseconds (`us`), milliseconds (`ms`), seconds (`s`), minutes (`m`), and hours (`h`). The default is `60m`. |
| 40 | + |
| 41 | +.^|`--orphans` |
| 42 | +|Prune all replication controllers that no longer have a `DeploymentConfig` object, has status of `Complete` or `Failed`, and has a replica count of zero. |
| 43 | + |
| 44 | +.^|`--replica-sets=true\|false` |
| 45 | +|If `true`, replica sets are included in the pruning process. The default is `false`. |
| 46 | + |
| 47 | +[IMPORTANT] |
| 48 | +==== |
| 49 | +This flag is a Technology Preview feature. |
| 50 | +==== |
35 | 51 | |===
|
36 | 52 |
|
37 |
| -To see what a pruning operation would delete: |
| 53 | +.Procedure |
38 | 54 |
|
| 55 | +. To see what a pruning operation would delete, run the following command: |
| 56 | ++ |
39 | 57 | [source,terminal]
|
40 | 58 | ----
|
41 | 59 | $ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \
|
42 | 60 | --keep-younger-than=60m
|
43 | 61 | ----
|
44 | 62 |
|
45 |
| -To actually perform the prune operation: |
46 |
| - |
| 63 | +. To actually perform the prune operation, add the `--confirm` flag: |
| 64 | ++ |
47 | 65 | [source,terminal]
|
48 | 66 | ----
|
49 | 67 | $ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \
|
|
0 commit comments