From 49281e494a1865bf8e90bd250673f4d8618b71a5 Mon Sep 17 00:00:00 2001 From: Adam Cmiel Date: Wed, 24 Jul 2024 14:21:26 +0200 Subject: [PATCH] tekton-ci: prune build-templates-e2e harder (#4168) * tekton-ci: prune build-templates-e2e harder The cleanup-cronjob running in the tekton-ci namespace deletes Applications used for e2e-tests. Currently, it deletes applications at least 3 days old. This doesn't seem to be enough to keep up with the rate of e2e-testing in build-definitions anymore. Remove applications after 1 day instead. Signed-off-by: Adam Cmiel * tekton-ci: run cleanup-cronjob more often Run hourly instead of daily. Currently, we're deleting e2e-tests Applications after 1 day + up to 1 day. Let's make that "+ up to 1 hour" Signed-off-by: Adam Cmiel --------- Signed-off-by: Adam Cmiel --- components/tekton-ci/production/cleanup-cronjob.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/tekton-ci/production/cleanup-cronjob.yaml b/components/tekton-ci/production/cleanup-cronjob.yaml index 761e49d09b6..61f8b410b04 100644 --- a/components/tekton-ci/production/cleanup-cronjob.yaml +++ b/components/tekton-ci/production/cleanup-cronjob.yaml @@ -3,7 +3,7 @@ kind: CronJob metadata: name: cleanup-stale-resources spec: - schedule: "0 1 * * *" #Daily at 01:00 + schedule: "0 * * * *" # hourly jobTemplate: spec: template: @@ -17,7 +17,7 @@ spec: - -c - | date; echo Cleaning up the stale applications - oc get application -n build-templates-e2e -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk '$2 <= "'$(date -d'now-3 days' --iso-8601=seconds --utc | sed 's/+00:00/Z/')'" { print $1 }' | xargs --no-run-if-empty oc delete application -n build-templates-e2e + oc get application -n build-templates-e2e -o go-template --template '{{range .items}}{{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' | awk '$2 <= "'$(date -d '1 day ago' --iso-8601=seconds --utc | sed 's/+00:00/Z/')'" { print $1 }' | xargs --no-run-if-empty oc delete application -n build-templates-e2e resources: limits: cpu: 100m