Skip to main contentIBM Cloud Pak Playbook

OpenShift Platform Day2 - Miscellaneous - Pruning

Pruning Overview: Managing Leftover Objects

During the normal operation and utilization of the cluster and cluster services, objects created in OpenShift can accumulate. Maintaining all previous versions of all the objects may end up consuming significant amount of storage which may have an impact on the performance of elements of the platform.

The following are some area that might to be reviewed regularly:

  • etcd data storage. Big etcd structure may slowdown the response of any activity related to etcd.
  • local container registry. Big registry will slow down the push and pull image operation.
  • /var/lib/containers. This is the location of the container runtime and container ephemeral storage area.

Architecting and Operating OpenShift Clusters: OpenShift for Infrastructure and Operations Teams
https://www.oreilly.com/library/view/architecting-and-operating/9781484249857/

Pruning

Over time, API objects created in OpenShift Container Platform can accumulate in the cluster’s etcd data store through normal user operations, such as when building and deploying applications.
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.

  • Pruning groups
  • Pruning deployments
  • Pruning builds
  • Pruning images
  • Pruning cron jobs

Garbage Collection

There are two types of Garbage Collection

  • Container Garbage collection.
  • Image Garbage collection.

Both of these can be tuned by modifying the the Kubelet argument settings at the Node ConfigMap. For more information please look at Architecting and Operating OpenShift Clusters: OpenShift for Infrastructure and Operations Teams