CHAPTER 8. PRUNING OBJECTS TO RECLAIM RESOURCES Table 8.2. Prune deployments CLI configuration options 8.4. PRUNING BUILDS In order to prune  DeploymentConfig  objects that are no longer required by the system due to age and status, administrators can run the following command: $ oc adm prune deployments [<options>] 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: $ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \ --keep-younger-than=60m To actually perform the prune operation: $ oc adm prune deployments --orphans --keep-complete=5 --keep-failed=1 \ --keep-younger-than=60m --confirm In order to prune builds that are no longer required by the system due to age and status, administrators can run the following command: $ oc adm prune builds [<options>] Table 8.3. Prune builds CLI configuration options Option Description --confirm Indicate that pruning should occur, instead of performing a dry-run. 109