2020-05-29 20:26:50 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: kube-janitor
|
|
|
|
namespace: kube-janitor
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRole
|
|
|
|
metadata:
|
|
|
|
name: kube-janitor
|
|
|
|
rules:
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- events
|
|
|
|
verbs:
|
|
|
|
- create
|
|
|
|
- apiGroups:
|
|
|
|
- "*"
|
|
|
|
resources:
|
|
|
|
- "*"
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- watch
|
|
|
|
- list
|
|
|
|
- delete
|
|
|
|
---
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
metadata:
|
|
|
|
name: kube-janitor
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: kube-janitor
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: kube-janitor
|
|
|
|
namespace: kube-janitor
|
|
|
|
---
|
|
|
|
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: kube-janitor
|
|
|
|
namespace: kube-janitor
|
|
|
|
data:
|
|
|
|
rules.yaml: |-
|
|
|
|
rules:
|
|
|
|
- id: tekton-tasks
|
|
|
|
resources:
|
|
|
|
- pods
|
2020-06-05 21:49:21 +00:00
|
|
|
- pipelineruns
|
2020-05-29 20:26:50 +00:00
|
|
|
jmespath: "(metadata.labels.\"tekton.dev/pipeline\")"
|
2020-06-05 21:49:21 +00:00
|
|
|
ttl: 3h
|
2020-05-29 20:26:50 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
application: kube-janitor
|
|
|
|
version: v20.4.1
|
|
|
|
name: kube-janitor
|
|
|
|
namespace: kube-janitor
|
2021-05-01 16:31:53 +00:00
|
|
|
annotations:
|
2021-06-18 18:17:27 +00:00
|
|
|
configmap.reloader.stakater.com/reload: "kube-janitor"
|
2020-05-29 20:26:50 +00:00
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
application: kube-janitor
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
application: kube-janitor
|
|
|
|
version: v20.4.1
|
|
|
|
spec:
|
|
|
|
serviceAccountName: kube-janitor
|
|
|
|
containers:
|
|
|
|
- name: janitor
|
|
|
|
image: hjacobs/kube-janitor:20.4.1
|
|
|
|
args:
|
|
|
|
- --interval=15
|
|
|
|
- --rules-file=/config/rules.yaml
|
|
|
|
- --include-namespaces=tekton-pipelines
|
2020-06-10 11:24:40 +00:00
|
|
|
- --include-resources=pods,pipelineruns,taskruns
|
2020-05-29 20:26:50 +00:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
memory: 100Mi
|
|
|
|
requests:
|
|
|
|
memory: 100Mi
|
|
|
|
securityContext:
|
|
|
|
readOnlyRootFilesystem: true
|
|
|
|
runAsNonRoot: true
|
|
|
|
runAsUser: 1000
|
|
|
|
volumeMounts:
|
|
|
|
- name: config-volume
|
|
|
|
mountPath: /config
|
|
|
|
volumes:
|
|
|
|
- name: config-volume
|
|
|
|
configMap:
|
|
|
|
name: kube-janitor
|