:_mod-docs-content-type: ASSEMBLY
[id="pruning-objects"]
= Pruning objects to reclaim resources
include::_attributes/common-attributes.adoc[]
:context: pruning-objects

toc::[]

Over time, API objects created in {product-title} can accumulate in the
cluster's etcd data store through normal user operations, such as when building
and deploying applications.

ifndef::openshift-rosa,openshift-dedicated[]
Cluster administrators can periodically prune older versions of objects from the
cluster that are no longer required. For example, by pruning images you can delete
older images and layers that are no longer in use, but are still taking up disk
space.
endif::openshift-rosa,openshift-dedicated[]
ifdef::openshift-rosa,openshift-dedicated[]
A user with the `dedicated-admin` role can periodically prune older versions of objects from the
cluster that are no longer required. For example, by pruning images you can delete
older images and layers that are no longer in use, but are still taking up disk
space.
endif::openshift-rosa,openshift-dedicated[]

include::modules/pruning-basic-operations.adoc[leveloffset=+1]
include::modules/pruning-groups.adoc[leveloffset=+1]
include::modules/pruning-deployments.adoc[leveloffset=+1]
include::modules/pruning-builds.adoc[leveloffset=+1]

ifndef::openshift-rosa,openshift-dedicated[]
[role="_additional-resources"]
.Additional resources
* xref:../cicd/builds/advanced-build-operations.adoc#builds-build-pruning-advanced-build-operations[Performing advanced builds -> Pruning builds]
endif::openshift-rosa,openshift-dedicated[]

include::modules/pruning-images.adoc[leveloffset=+1]
//cannot create resource "serviceaccounts". cannot create resource "cronjobs"
ifndef::openshift-rosa,openshift-dedicated[] 
include::modules/pruning-images-manual.adoc[leveloffset=+1]

[role="_additional-resources"]
.Additional resources
* xref:../registry/accessing-the-registry.adoc#accessing-the-registry[Accessing the registry]
* xref:../registry/securing-exposing-registry.adoc#securing-exposing-registry[Exposing the registry]
* See
xref:../registry/configuring-registry-operator.adoc#configuring-registry-operator[Image
Registry Operator in {product-title}] for information on how to create a
registry route.
endif::openshift-rosa,openshift-dedicated[]

// cannot patch resource "configs" 
ifndef::openshift-rosa,openshift-dedicated[] 
include::modules/pruning-hard-pruning-registry.adoc[leveloffset=+1]
endif::openshift-rosa,openshift-dedicated[]

include::modules/pruning-cronjobs.adoc[leveloffset=+1]

[role="_additional-resources"]
.Additional resources
// When the Operators book is added to ROSA/OSD, check if this link is valid.
ifndef::openshift-rosa,openshift-dedicated[]
* xref:../nodes/jobs/nodes-nodes-jobs.adoc#nodes-nodes-jobs_nodes-nodes-jobs[Running tasks in pods using jobs]
endif::openshift-rosa,openshift-dedicated[]
* xref:../applications/quotas/quotas-setting-across-multiple-projects.adoc#setting-quotas-across-multiple-projects[Resource quotas across multiple projects]
// When the Operators book is added to ROSA/OSD, check if this link is valid.
ifndef::openshift-rosa,openshift-dedicated[]
* xref:../authentication/using-rbac.adoc#using-rbac[Using RBAC to define and apply permissions]
endif::openshift-rosa,openshift-dedicated[]
