A job for cleaning up old OpenShift or Kubernetes objects created by one-time analyses in Thoth.
This periodic job (CronJob) queries Jobs, ImageStreams, ConfigMaps and BuildConfigs that have label set to mark=cleanup
and based on TTL, old objects are deleted. The TTL can be provided in the following ways:
THOTH_CLEANUP_DEFAULT_TTL
environment variable provided to the thoth-cleanup CronJob deploymentttl
key - for example in the job spec label ttl=5d
means "delete the given job after 5 days" - this overrides the above configuration optionIf there is no ttl set in the resourse labels and there is no THOTH_CLEANUP_DEFAULT_TTL
set in the deployement, the TTL configuration defaults to 10 minutes.
You can run cleanup-job locally from your laptop. It will transparently talk to the cluster - assuming you are logged in and have sufficient privileges on the cleaned namespace (edit is required):
.. code-block:: console
$ pipenv install # Install all the requirements
$ oc login
TLS verification is skipped if cluster certs should not be checked (unsafe).