-
Notifications
You must be signed in to change notification settings - Fork 31
/
tekton-pruner.yaml
84 lines (84 loc) · 1.93 KB
/
tekton-pruner.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
apiVersion: batch/v1
kind: CronJob
metadata:
labels:
tektonconfig.operator.tekton.dev/pruner: "true"
name: tekton-resource-pruner
spec:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
jobTemplate:
spec:
backoffLimit: 3
template:
spec:
containers:
- args:
- 'tkn pipelinerun delete --keep=20 -f'
command:
- /bin/sh
- -c
image: quay.io/openshift-pipeline/openshift-pipelines-pipelines-cli-tkn-rhel8@sha256:e1fa47811f156e48a61741aabe73ef85078960567822a4b23c174c0d9b4d0ee6
imagePullPolicy: IfNotPresent
name: tekton-resource-pruner
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: FallbackToLogsOnError
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
serviceAccount: cad-tekton-pruner
serviceAccountName: cad-tekton-pruner
terminationGracePeriodSeconds: 30
ttlSecondsAfterFinished: 3600
schedule: 0 * * * *
successfulJobsHistoryLimit: 3
suspend: false
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: cad-tekton-pruner
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: cad-tekton-pruner-role
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- delete
- get
- watch
- list
- apiGroups:
- tekton.dev
resources:
- pipelineruns
- taskruns
verbs:
- delete
- list
- get
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: cad-tekton-pruner-role-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: cad-tekton-pruner-role
subjects:
- kind: ServiceAccount
name: cad-tekton-pruner