mirror of
https://github.com/appuio/appuio-pruner.git
synced 2026-02-05 09:45:36 +01:00
master
Individual cronjobs can be disabled
APPUiO Pruner
This repository contains an Ansible role to install the APPUiO object pruner, a set of 3 cronjobs which clean up old deployments, builds and images respectively.
What does it do?
It runs oc adm prune XXX.
Service Account
The pruner jobs access the OpenShift API using the service account which the job was started with. The playbook will create the required service account, roles and role bindings for the jobs to do their job.
Requirements
- OpenShift Container Platform 3.9 or later, or
- OKD 3.9 or later
Role variables
| Name | Default value | Description |
|---|---|---|
| appuio_pruner_namespace | appuio-pruner |
Namespace to install the APPUiO pruner into |
| appuio_pruner_image | "docker.io/appuio/oc:{{ openshift_release }}" |
Image for the pruner job |
| appuio_pruner_schedule | @hourly |
Schedule in Cron format |
| appuio_pruner_disabled_jobs | [] |
List of pruner jobs to be disabled |
| appuio_pruner_extra_args_ | [] |
List of extra args to add to a prune command. See below |
| appuio_pruner_state | present |
When set to absent, the pruner is removed from the cluster |
Customizing the oc prune commands
You can use the appuio_pruner_extra_args_<kind> variable to add extra arguments to
the commands being executed inside the containers. Example:
appuio_pruner_extra_args_images:
- --force-insecure
Dependencies
Example Usage
playbook.yml:
roles:
- role: appuio-pruner
appuio_pruner_namespace: appuio-pruner
Description
The APPUiO pruner prunes old builds, deployments and registry images from an OpenShift cluster.