1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 15:46:57 +01:00
Files
openshift-docs/modules/pruning-deployments.adoc
Steven Smith 82a5119e68 Removes back ticks in headings
Adds1

Adds2

Adds4
2021-04-12 16:35:21 +00:00

52 lines
1.7 KiB
Plaintext

// Module included in the following assemblies:
//
// * applications/pruning-objects.adoc
[id="pruning-deployments_{context}"]
= Pruning DeploymentConfig objects
To prune `DeploymentConfig` objects that are no longer required by the system due to age and status, administrators can run the following command:
[source,terminal]
----
$ oc adm prune deployments [<options>]
----
.Prune deployments CLI configuration options
[cols="4,8",options="header"]
|===
|Option |Description
.^|`--confirm`
|Indicate that pruning should occur, instead of performing a dry-run.
.^|`--orphans`
|Prune all deployments that no longer have a `DeploymentConfig` object, has status of `Complete` or `Failed`, and has a replica count of zero.
.^|`--keep-complete=<N>`
|Per the `DeploymentConfig` object, keep the last `N` deployments that have a status of `Complete` and replica count of zero. (default `5`)
.^|`--keep-failed=<N>`
|Per the `DeploymentConfig` object, keep the last `N` deployments that have a status of `Failed` and replica count of zero. (default `1`)
.^|`--keep-younger-than=<duration>`
|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`).
|===
To see what a pruning operation would delete:
[source,terminal]
----
$ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \
--keep-younger-than=60m
----
To actually perform the prune operation:
[source,terminal]
----
$ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \
--keep-younger-than=60m --confirm
----