Browse Source

Start adding cronjob to do the clearup for us

todo:
* Service account/secret to access tekton resources
* Tune - I dont know what happens if you clean up taskruns only for
  example
35-pssaas-kerberos-bypass
Jonathan Christison 3 years ago
parent
commit
798675466f
  1. 21
      k8s/stage/osh-client-tekton/tekton-cleanup-cronjob.yaml
  2. 8
      k8s/stage/osh-client-tekton/tekton-prune.yaml

21
k8s/stage/osh-client-tekton/tekton-cleanup-cronjob.yaml

@ -0,0 +1,21 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: tekton-terminator
namespace: pct-security-tooling
spec:
schedule: "*/10 * * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: tekton-cleanup
image: quay.io/openshift-pipeline/openshift-pipelines-cli-tkn:1.11
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- tkn pipelinerun delete --keep 10 && tkn taskrun delete --keep 20
restartPolicy: OnFailure

8
k8s/stage/osh-client-tekton/tekton-prune.yaml

@ -1,8 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: pct-security-tooling
annotations:
operator.tekton.dev/prune.resource: taskrun, pipelinerun
operator.tekton.dev/prune.schedule: '*/10 * * * *'
operator.tekton.dev/prune.strategy.keep: "10"
Loading…
Cancel
Save