-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrbac-role-controller.yaml
86 lines (86 loc) · 1.79 KB
/
rbac-role-controller.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
85
86
{{- $platform := "bmrg" -}}
{{- $product := "flow" -}}
{{- $tier := "rbac" -}}
{{- $values := .Values -}}
{{- $context := . -}}
{{- if $values.workers.security.enable }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "bmrg.name" (dict "context" $context "component" "handler" ) }}
labels:
{{- include "bmrg.labels.chart" (dict "context" $context "tier" $tier ) | nindent 4 }}
rules:
{{- if .Capabilities.APIVersions.Has "security.openshift.io/v1" }}
- apiGroups:
- security.openshift.io
resourceNames:
- {{ $values.workers.security.policy }}
resources:
- securitycontextconstraints
verbs:
- use
{{- else }}
- apiGroups:
- extensions
resourceNames:
- {{ $values.workers.security.policy }}
resources:
- podsecuritypolicies
verbs:
- use
{{- end }}
# objects used to create and execute tasks
# Handler needs to watch Pods created by TaskRuns to see them progress.
# logs get/watch are used to stream the pods logs
- apiGroups:
- ""
resources:
- pods
- pods/log
verbs:
- get
- list
- watch
# pvc and pv are mentioned as we use auto management of pv
- apiGroups:
- ""
resources:
- persistentvolumeclaims
- persistentvolumes
verbs:
- get
- list
- create
- watch
- delete
# all workflow tasks are tekton TaskRuns and Tasks
# https://github.com/cdfoundation/tekton-helm-chart/blob/master/charts/tekton-pipeline/templates/tekton-pipelines-controller-cluster-access-clusterrole.yaml
- apiGroups:
- tekton.dev
resources:
- tasks
- taskruns
- tasks/status
- taskruns/status
verbs:
- get
- list
- create
- update
- patch
- watch
- delete
# configmaps specifically need patch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- create
- watch
- patch
- delete
{{- end }}