File tree Expand file tree Collapse file tree 7 files changed +257
-10
lines changed
olm-catalog/smart-gateway-operator/manifests Expand file tree Collapse file tree 7 files changed +257
-10
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,78 @@ spec:
127
127
mediatype : image/svg+xml
128
128
install :
129
129
spec :
130
+ clusterPermissions :
131
+ - rules :
132
+ - apiGroups :
133
+ - authentication.k8s.io
134
+ resources :
135
+ - tokenreviews
136
+ verbs :
137
+ - create
138
+ - apiGroups :
139
+ - authorization.k8s.io
140
+ resources :
141
+ - subjectaccessreviews
142
+ verbs :
143
+ - create
144
+ - apiGroups :
145
+ - rbac.authorization.k8s.io
146
+ resources :
147
+ - roles
148
+ verbs :
149
+ - create
150
+ - list
151
+ - get
152
+ - update
153
+ - patch
154
+ - watch
155
+ - apiGroups :
156
+ - rbac.authorization.k8s.io
157
+ resources :
158
+ - clusterroles
159
+ verbs :
160
+ - create
161
+ - list
162
+ - get
163
+ - update
164
+ - patch
165
+ - watch
166
+ - apiGroups :
167
+ - rbac.authorization.k8s.io
168
+ resources :
169
+ - clusterrolebindings
170
+ verbs :
171
+ - create
172
+ - list
173
+ - get
174
+ - update
175
+ - patch
176
+ - watch
177
+ - apiGroups :
178
+ - " "
179
+ resources :
180
+ - namespaces
181
+ verbs :
182
+ - get
183
+ - list
184
+ - watch
185
+ - apiGroups :
186
+ - rbac.authorization.k8s.io
187
+ resources :
188
+ - rolebindings
189
+ verbs :
190
+ - get
191
+ - list
192
+ - watch
193
+ - apiGroups :
194
+ - " "
195
+ resources :
196
+ - events
197
+ verbs :
198
+ - create
199
+ - patch
200
+ - update
201
+ serviceAccountName : smart-gateway-operator
130
202
deployments :
131
203
- name : smart-gateway-operator
132
204
spec :
@@ -186,6 +258,7 @@ spec:
186
258
- events
187
259
- configmaps
188
260
- secrets
261
+ - serviceaccounts
189
262
verbs :
190
263
- create
191
264
- delete
@@ -249,6 +322,28 @@ spec:
249
322
- patch
250
323
- update
251
324
- watch
325
+ - apiGroups :
326
+ - rbac.authorization.k8s.io
327
+ resources :
328
+ - rolebindings
329
+ verbs :
330
+ - create
331
+ - apiGroups :
332
+ - " "
333
+ resources :
334
+ - namespaces
335
+ verbs :
336
+ - get
337
+ - list
338
+ - watch
339
+ - apiGroups :
340
+ - rbac.authorization.k8s.io
341
+ resources :
342
+ - rolebindings
343
+ verbs :
344
+ - get
345
+ - list
346
+ - watch
252
347
serviceAccountName : smart-gateway-operator
253
348
strategy : deployment
254
349
installModes :
Original file line number Diff line number Diff line change 1
1
apiVersion : rbac.authorization.k8s.io/v1
2
+ kind : ClusterRole
3
+ metadata :
4
+ name : smart-gateway-operator
5
+ rules :
6
+ - apiGroups :
7
+ - authentication.k8s.io
8
+ resources :
9
+ - tokenreviews
10
+ verbs :
11
+ - create
12
+ - apiGroups :
13
+ - authorization.k8s.io
14
+ resources :
15
+ - subjectaccessreviews
16
+ verbs :
17
+ - create
18
+ - apiGroups :
19
+ - rbac.authorization.k8s.io
20
+ resources :
21
+ - roles
22
+ verbs :
23
+ - create
24
+ - list
25
+ - get
26
+ - update
27
+ - patch
28
+ - watch
29
+ - apiGroups :
30
+ - rbac.authorization.k8s.io
31
+ resources :
32
+ - clusterroles
33
+ verbs :
34
+ - create
35
+ - list
36
+ - get
37
+ - update
38
+ - patch
39
+ - watch
40
+ - apiGroups :
41
+ - rbac.authorization.k8s.io
42
+ resources :
43
+ - clusterrolebindings
44
+ verbs :
45
+ - create
46
+ - list
47
+ - get
48
+ - update
49
+ - patch
50
+ - watch
51
+ - apiGroups :
52
+ - " "
53
+ resources :
54
+ - namespaces
55
+ verbs :
56
+ - get
57
+ - list
58
+ - watch
59
+ - apiGroups :
60
+ - rbac.authorization.k8s.io
61
+ resources :
62
+ - rolebindings
63
+ verbs :
64
+ - get
65
+ - list
66
+ - watch
67
+ - apiGroups :
68
+ - " "
69
+ resources :
70
+ - events
71
+ verbs :
72
+ - create
73
+ - patch
74
+ - update
75
+ ---
76
+ apiVersion : rbac.authorization.k8s.io/v1
2
77
kind : Role
3
78
metadata :
4
- creationTimestamp : null
5
79
name : smart-gateway-operator
6
80
rules :
7
81
- apiGroups :
15
89
- events
16
90
- configmaps
17
91
- secrets
92
+ - serviceaccounts
18
93
verbs :
19
94
- create
20
95
- delete
@@ -78,3 +153,26 @@ rules:
78
153
- patch
79
154
- update
80
155
- watch
156
+ - apiGroups :
157
+ - rbac.authorization.k8s.io
158
+ resources :
159
+ - rolebindings
160
+ verbs :
161
+ - create
162
+ - apiGroups :
163
+ - " "
164
+ resources :
165
+ - namespaces
166
+ verbs :
167
+ - get
168
+ - list
169
+ - watch
170
+ - apiGroups :
171
+ - rbac.authorization.k8s.io
172
+ resources :
173
+ - rolebindings
174
+ verbs :
175
+ - get
176
+ - list
177
+ - watch
178
+
Original file line number Diff line number Diff line change 1
- kind : RoleBinding
1
+ kind : ClusterRoleBinding
2
2
apiVersion : rbac.authorization.k8s.io/v1
3
3
metadata :
4
4
name : smart-gateway-operator
5
5
subjects :
6
6
- kind : ServiceAccount
7
7
name : smart-gateway-operator
8
+ namespace : service-telemetry
8
9
roleRef :
9
- kind : Role
10
+ kind : ClusterRole
10
11
name : smart-gateway-operator
11
12
apiGroup : rbac.authorization.k8s.io
12
13
---
14
+ kind : RoleBinding
13
15
apiVersion : rbac.authorization.k8s.io/v1
14
- kind : ClusterRoleBinding
15
16
metadata :
16
- name : smart-gateway-auth-delegator
17
+ name : smart-gateway-operator
17
18
subjects :
18
19
- kind : ServiceAccount
19
- name : default
20
- namespace : placeholder
20
+ name : smart-gateway-operator
21
21
roleRef :
22
+ kind : Role
23
+ name : smart-gateway-operator
22
24
apiGroup : rbac.authorization.k8s.io
23
- kind : ClusterRole
24
- name : system:auth-delegator
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ tls_secret_name: elasticsearch-es-cert
9
9
exporter_host : 0.0.0.0
10
10
exporter_port : 8081
11
11
block_event_bus : false
12
+ service_account_name : smart-gateway
12
13
13
14
# - This image works on OCP 4.6, 4.7, and 4.8
14
15
oauth_proxy_image : image-registry.openshift-image-registry.svc:5000/openshift/oauth-proxy:v4.4
Original file line number Diff line number Diff line change 44
44
session_secret : " {{ lookup('password', '/dev/null') }}"
45
45
when : session_secret.resources|length == 0
46
46
47
+ - name : Create Smart Gateway ServiceAccount
48
+ k8s :
49
+ state : present
50
+ definition :
51
+ apiVersion : v1
52
+ kind : ServiceAccount
53
+ metadata :
54
+ name : " {{ service_account_name }}"
55
+ namespace : " {{ meta.namespace }}"
56
+
57
+ - name : Create Smart Gateway Role
58
+ k8s :
59
+ state : present
60
+ definition : " {{ lookup('template', 'sg-role.yaml.j2') | from_yaml }}"
61
+
62
+ - name : Create Smart Gateway RoleBinding
63
+ k8s :
64
+ definition :
65
+ apiVersion : rbac.authorization.k8s.io/v1
66
+ kind : ClusterRoleBinding
67
+ metadata :
68
+ labels :
69
+ app.kubernetes.io/component : smart-gateway
70
+ app.kubernetes.io/name : smart-gateway
71
+ app.kubernetes.io/part-of : service-telemetry-framework
72
+ name : smart-gateway
73
+ roleRef :
74
+ apiGroup : rbac.authorization.k8s.io
75
+ kind : ClusterRole
76
+ name : smart-gateway
77
+ subjects :
78
+ - kind : ServiceAccount
79
+ name : smart-gateway
80
+ namespace : " {{ meta.namespace }}"
81
+
47
82
# used as part of the Deployment object in order to trigger pod restarts on ConfigMap change
48
83
- name : Get Smart Gateway ConfigMap Environment
49
84
set_fact :
Original file line number Diff line number Diff line change 34
34
- -tls-cert=/etc/tls/private/tls.crt
35
35
- -tls-key=/etc/tls/private/tls.key
36
36
- -cookie-secret-file=/etc/proxy/secrets/session_secret
37
- - -openshift-service-account=NA
37
+ - -openshift-service-account={{ service_account_name }}
38
38
- -upstream=http://localhost:8081/
39
39
- ' -openshift-delegate-urls={"/": {"resource": "namespaces", "verb": "get"}}'
40
40
ports :
@@ -136,6 +136,7 @@ spec:
136
136
{% endfor %}
137
137
{% endif %}
138
138
{% endif %}
139
+ serviceAccountName : {{ service_account_name }}
139
140
volumes :
140
141
{% if (applications | selectattr('name','equalto','prometheus') | list | count > 0) %}
141
142
- name : {{ meta.name }}-proxy-tls
Original file line number Diff line number Diff line change
1
+ apiVersion: rbac.authorization.k8s.io/v1
2
+ kind: ClusterRole
3
+ metadata:
4
+ name: smart-gateway
5
+ rules:
6
+ - apiGroups:
7
+ - authentication.k8s.io
8
+ resources:
9
+ - tokenreviews
10
+ verbs:
11
+ - create
12
+ - apiGroups:
13
+ - authorization.k8s.io
14
+ resources:
15
+ - subjectaccessreviews
16
+ verbs:
17
+ - create
You can’t perform that action at this time.
0 commit comments