-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathoperator.yaml
More file actions
703 lines (703 loc) · 22.3 KB
/
operator.yaml
File metadata and controls
703 lines (703 loc) · 22.3 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
{{define "handlerPrefix"}}{{with $prefix := .HandlerPrefix}}{{$prefix | printf "%s-"}}{{end -}}{{end}}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{template "handlerPrefix" .}}nmstate-metrics
namespace: {{ .HandlerNamespace }}
labels:
prometheus.nmstate.io: "true"
app: kubernetes-nmstate
component: kubernetes-nmstate-metrics
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
name: {{template "handlerPrefix" .}}nmstate-metrics
template:
metadata:
labels:
prometheus.nmstate.io: "true"
app: kubernetes-nmstate
component: kubernetes-nmstate-metrics
name: {{template "handlerPrefix" .}}nmstate-metrics
annotations:
description: kubernetes-nmstate-metrics dump nmstate metrics
target.workload.openshift.io/management: |
{"effect": "PreferredDuringScheduling"}
spec:
serviceAccountName: {{template "handlerPrefix" .}}nmstate-handler
nodeSelector: {{ toYaml .InfraNodeSelector | nindent 8 }}
tolerations: {{ toYaml .InfraTolerations | nindent 8 }}
affinity: {{ toYaml .WebhookAffinity | nindent 8 }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
component: kubernetes-nmstate-metrics
priorityClassName: system-cluster-critical
containers:
- name: nmstate-metrics
args:
- --zap-time-encoding=iso8601
# Replace this with the built image name
image: {{ .HandlerImage }}
imagePullPolicy: {{ .HandlerPullPolicy }}
command:
- manager
resources:
requests:
cpu: "30m"
memory: "20Mi"
limits:
cpu: "500m"
memory: "1Gi"
terminationMessagePolicy: FallbackToLogsOnError
env:
- name: WATCH_NAMESPACE
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: RUN_METRICS_MANAGER
value: ""
- name: OPERATOR_NAME
value: "{{template "handlerPrefix" .}}nmstate"
- name: ENABLE_PROFILER
value: "False"
- name: PROFILER_PORT
value: "6060"
- args:
- --logtostderr
- --secure-listen-address=:8443
- --upstream=http://127.0.0.1:8089
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
image: {{ .KubeRBACProxyImage }}
imagePullPolicy: IfNotPresent
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: metrics
protocol: TCP
readinessProbe:
tcpSocket:
port: metrics
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
tcpSocket:
port: metrics
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
resources:
requests:
cpu: "10m"
memory: "20Mi"
limits:
cpu: "500m"
memory: "1Gi"
terminationMessagePolicy: FallbackToLogsOnError
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{template "handlerPrefix" .}}nmstate-webhook
namespace: {{ .HandlerNamespace }}
labels:
app: kubernetes-nmstate
component: kubernetes-nmstate-webhook
spec:
replicas: {{ .WebhookReplicas }}
strategy:
type: Recreate
selector:
matchLabels:
name: {{template "handlerPrefix" .}}nmstate-webhook
template:
metadata:
labels:
app: kubernetes-nmstate
component: kubernetes-nmstate-webhook
name: {{template "handlerPrefix" .}}nmstate-webhook
annotations:
description: kubernetes-nmstate-webhook resets NNCP status
target.workload.openshift.io/management: |
{"effect": "PreferredDuringScheduling"}
spec:
serviceAccountName: {{template "handlerPrefix" .}}nmstate-handler
nodeSelector: {{ toYaml .InfraNodeSelector | nindent 8 }}
tolerations: {{ toYaml .InfraTolerations | nindent 8 }}
affinity: {{ toYaml .WebhookAffinity | nindent 8 }}
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
component: kubernetes-nmstate-webhook
priorityClassName: system-cluster-critical
containers:
- name: nmstate-webhook
args:
- --zap-time-encoding=iso8601
# Replace this with the built image name
image: {{ .HandlerImage }}
imagePullPolicy: {{ .HandlerPullPolicy }}
command:
- manager
resources:
requests:
cpu: "30m"
memory: "20Mi"
limits:
cpu: "500m"
memory: "1Gi"
terminationMessagePolicy: FallbackToLogsOnError
env:
- name: WATCH_NAMESPACE
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: RUN_WEBHOOK_SERVER
value: ""
- name: OPERATOR_NAME
value: "{{template "handlerPrefix" .}}nmstate"
- name: ENABLE_PROFILER
value: "False"
- name: PROFILER_PORT
value: "6060"
ports:
- containerPort: 9443
name: webhook-server
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: webhook-server
scheme: HTTPS
httpHeaders:
- name: Content-Type
value: application/json
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /readyz
port: webhook-server
scheme: HTTPS
httpHeaders:
- name: Content-Type
value: application/json
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
volumeMounts:
- name: tls-key-pair
readOnly: true
mountPath: /tmp/k8s-webhook-server/serving-certs/
volumes:
- name: tls-key-pair
secret:
{{- if not .IsOpenShift }}
secretName: {{template "handlerPrefix" .}}nmstate-webhook
{{- else }}
secretName: {{template "handlerPrefix" .}}openshift-nmstate-webhook
{{- end }}
{{- if not .IsOpenShift }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{template "handlerPrefix" .}}nmstate-cert-manager
namespace: {{ .HandlerNamespace }}
labels:
app: kubernetes-nmstate
component: kubernetes-nmstate-cert-manager
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
name: {{template "handlerPrefix" .}}nmstate-cert-manager
template:
metadata:
labels:
app: kubernetes-nmstate
component: kubernetes-nmstate-cert-manager
name: {{template "handlerPrefix" .}}nmstate-cert-manager
annotations:
description: kubernetes-nmstate-webhook rotate webhook certs
target.workload.openshift.io/management: |
{"effect": "PreferredDuringScheduling"}
spec:
serviceAccountName: {{template "handlerPrefix" .}}nmstate-handler
nodeSelector: {{ toYaml .InfraNodeSelector | nindent 8 }}
tolerations: {{ toYaml .InfraTolerations | nindent 8 }}
affinity: {{ toYaml .WebhookAffinity | nindent 8 }}
priorityClassName: system-cluster-critical
containers:
- name: nmstate-cert-manager
args:
- --zap-time-encoding=iso8601
# Replace this with the built image name
image: {{ .HandlerImage }}
imagePullPolicy: {{ .HandlerPullPolicy }}
command:
- manager
resources:
requests:
cpu: "30m"
memory: "30Mi"
limits:
cpu: "500m"
memory: "1Gi"
terminationMessagePolicy: FallbackToLogsOnError
env:
- name: WATCH_NAMESPACE
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: COMPONENT
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/component']
- name: PART_OF
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/part-of']
- name: VERSION
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/version']
- name: MANAGED_BY
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/managed-by']
- name: RUN_CERT_MANAGER
value: ""
- name: OPERATOR_NAME
value: "{{template "handlerPrefix" .}}nmstate"
- name: ENABLE_PROFILER
value: "False"
- name: PROFILER_PORT
value: "6060"
- name: CA_ROTATE_INTERVAL
value: {{ .SelfSignConfiguration.CARotateInterval }}
- name: CA_OVERLAP_INTERVAL
value: {{ .SelfSignConfiguration.CAOverlapInterval }}
- name: CERT_ROTATE_INTERVAL
value: {{ .SelfSignConfiguration.CertRotateInterval }}
- name: CERT_OVERLAP_INTERVAL
value: {{ .SelfSignConfiguration.CertOverlapInterval }}
{{- end }}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{template "handlerPrefix" .}}nmstate-handler
namespace: {{ .HandlerNamespace }}
labels:
app: kubernetes-nmstate
component: kubernetes-nmstate-handler
spec:
selector:
matchLabels:
name: {{template "handlerPrefix" .}}nmstate-handler
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 10%
template:
metadata:
labels:
app: kubernetes-nmstate
component: kubernetes-nmstate-handler
name: {{template "handlerPrefix" .}}nmstate-handler
annotations:
description: kubernetes-nmstate-handler configures and presents node networking, reconciling declerative NNCP and reports with NNS and NNCE
target.workload.openshift.io/management: |
{"effect": "PreferredDuringScheduling"}
spec:
# Needed to force vlan filtering config with iproute commands until
# latest nmstate/NM is in place.
# https://github.com/nmstate/nmstate/pull/440
hostNetwork: true
# Use Default to get node's DNS configuration [1]
# [1] https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy
dnsPolicy: Default
serviceAccountName: {{template "handlerPrefix" .}}nmstate-handler
nodeSelector: {{ toYaml .HandlerNodeSelector | nindent 8 }}
tolerations: {{ toYaml .HandlerTolerations | nindent 8 }}
affinity: {{ toYaml .HandlerAffinity | nindent 8 }}
priorityClassName: system-node-critical
initContainers:
- name: ensure-dbus-socket
image: {{ .HandlerImage }}
imagePullPolicy: {{ .HandlerPullPolicy }}
command:
- sh
- -c
- "mkdir -p /host-run/dbus && test -e /host-run/dbus/system_bus_socket || touch /host-run/dbus/system_bus_socket"
volumeMounts:
- name: host-run
mountPath: /host-run
securityContext:
privileged: true
containers:
- name: nmstate-handler
args:
- --zap-time-encoding=iso8601
{{- if .LogLevelHandlerCommandArg }}
- --v
- "{{ .LogLevelHandlerCommandArg }}"
{{- end }}
# Replace this with the built image name
image: {{ .HandlerImage }}
imagePullPolicy: {{ .HandlerPullPolicy }}
command:
- manager
resources:
requests:
cpu: "100m"
memory: "100Mi"
limits:
cpu: "500m"
memory: "1Gi"
terminationMessagePolicy: FallbackToLogsOnError
env:
- name: WATCH_NAMESPACE
value: ""
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: COMPONENT
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/component']
- name: PART_OF
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/part-of']
- name: VERSION
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/version']
- name: MANAGED_BY
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/managed-by']
- name: OPERATOR_NAME
value: "{{template "handlerPrefix" .}}nmstate"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: ENABLE_PROFILER
value: "False"
- name: PROFILER_PORT
value: "6060"
- name: NMSTATE_INSTANCE_NODE_LOCK_FILE
value: "/var/k8s_nmstate/handler_lock"
- name: PROBE_DNS_HOST
value: "{{ .ProbeConfiguration.DNS.Host }}"
- name: METRICS_BIND_ADDRESS
value: "{{ .MetricsConfiguration.BindAddress }}"
volumeMounts:
- name: dbus-socket
mountPath: /run/dbus/system_bus_socket
- name: nmstate-lock
mountPath: /var/k8s_nmstate
- name: ovs-socket
mountPath: /run/openvswitch
- name: systemd-network
mountPath: /etc/systemd/network
securityContext:
privileged: true
readinessProbe:
exec:
command:
- cat
- /tmp/healthy
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 1
livenessProbe:
exec:
command:
- bash
- -c
- "if [ -f /tmp/kernel-mode ]; then nmstatectl show -k {{ .HandlerReadinessProbeExtraArg }} 2>&1; else nmstatectl show {{ .HandlerReadinessProbeExtraArg }} 2>&1; fi"
initialDelaySeconds: 60
periodSeconds: 60
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 5
volumes:
- name: host-run
hostPath:
path: /run
- name: dbus-socket
hostPath:
path: /run/dbus/system_bus_socket
- name: nmstate-lock
hostPath:
path: /var/k8s_nmstate
- name: ovs-socket
hostPath:
path: /run/openvswitch
- name: systemd-network
hostPath:
path: /etc/systemd/network
type: DirectoryOrCreate
---
apiVersion: v1
kind: Service
metadata:
name: {{template "handlerPrefix" .}}nmstate-webhook
namespace: {{ .HandlerNamespace }}
annotations:
service.beta.openshift.io/serving-cert-secret-name: {{template "handlerPrefix" .}}openshift-nmstate-webhook
labels:
app: kubernetes-nmstate
spec:
publishNotReadyAddresses: true
ports:
- port: 443
targetPort: 9443
selector:
name: {{template "handlerPrefix" .}}nmstate-webhook
---
apiVersion: v1
kind: Service
metadata:
name: {{template "handlerPrefix" .}}nmstate-monitor
namespace: {{ .HandlerNamespace }}
labels:
prometheus.nmstate.io: "true"
spec:
ports:
- name: metrics
port: 8443
protocol: TCP
targetPort: metrics
selector:
prometheus.nmstate.io: "true"
sessionAffinity: None
type: ClusterIP
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: {{template "handlerPrefix" .}}nmstate
annotations:
service.beta.openshift.io/inject-cabundle: "true"
labels:
app: kubernetes-nmstate
webhooks:
- name: nodenetworkconfigurationpolicies-mutate.nmstate.io
admissionReviewVersions: ["v1", "v1beta1"]
sideEffects: None
failurePolicy: Ignore
clientConfig:
service:
name: {{template "handlerPrefix" .}}nmstate-webhook
namespace: {{ .HandlerNamespace }}
path: "/nodenetworkconfigurationpolicies-mutate"
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["*"]
apiVersions: ["v1alpha1","v1beta1","v1"]
resources: ["nodenetworkconfigurationpolicies"]
- name: nodenetworkconfigurationpolicies-status-mutate.nmstate.io
admissionReviewVersions: ["v1", "v1beta1"]
sideEffects: None
failurePolicy: Ignore
clientConfig:
service:
name: {{template "handlerPrefix" .}}nmstate-webhook
namespace: {{ .HandlerNamespace }}
path: "/nodenetworkconfigurationpolicies-status-mutate"
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["*"]
apiVersions: ["v1alpha1","v1beta1","v1"]
resources: ["nodenetworkconfigurationpolicies/status"]
- name: nodenetworkconfigurationpolicies-timestamp-mutate.nmstate.io
admissionReviewVersions: ["v1", "v1beta1"]
sideEffects: None
failurePolicy: Ignore
clientConfig:
service:
name: {{template "handlerPrefix" .}}nmstate-webhook
namespace: {{ .HandlerNamespace }}
path: "/nodenetworkconfigurationpolicies-timestamp-mutate"
rules:
- operations: ["CREATE", "UPDATE"]
apiGroups: ["*"]
apiVersions: ["v1alpha1","v1beta1","v1"]
resources: ["nodenetworkconfigurationpolicies", "nodenetworkconfigurationpolicies/status"]
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
name: {{template "handlerPrefix" .}}nncp-validation-policy
labels:
app: kubernetes-nmstate
spec:
failurePolicy: Fail
matchConstraints:
resourceRules:
- apiGroups: ["nmstate.io"]
apiVersions: ["v1", "v1beta1"]
resources: ["nodenetworkconfigurationpolicies"]
operations: ["CREATE", "UPDATE"]
validations:
- expression: >-
request.operation != 'CREATE' ||
(size(object.metadata.name) <= 63 &&
(object.metadata.name == '' ||
object.metadata.name.matches('^[A-Za-z0-9]([-A-Za-z0-9_.]*[A-Za-z0-9])?$')))
messageExpression: "'invalid policy name: \"' + object.metadata.name + '\": must be no more than 63 characters or match label value format'"
reason: Invalid
- expression: >-
request.operation != 'UPDATE' ||
object.spec == oldObject.spec ||
(has(oldObject.status) && has(oldObject.status.conditions) &&
oldObject.status.conditions.exists(c,
c.type == 'Available' && c.reason != '' &&
c.reason != 'ConfigurationProgressing'))
messageExpression: "'policy ' + object.metadata.name + ' is still in progress'"
reason: Forbidden
- expression: >-
request.operation != 'UPDATE' ||
object.spec == oldObject.spec ||
((!has(object.spec.capture) && !has(oldObject.spec.capture)) ||
(has(object.spec.capture) && has(oldObject.spec.capture) &&
object.spec.capture == oldObject.spec.capture))
message: "invalid policy operation: capture field cannot be modified"
reason: Invalid
- expression: >-
!has(object.spec.nodeSelector) ||
object.spec.nodeSelector.all(k,
!format.labelValue().validate(object.spec.nodeSelector[k]).hasValue())
message: "nodeSelector values must be valid label values"
reason: Invalid
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
name: {{template "handlerPrefix" .}}nncp-validation-policy-binding
labels:
app: kubernetes-nmstate
spec:
policyName: {{template "handlerPrefix" .}}nncp-validation-policy
validationActions:
- Deny
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
namespace: {{ .HandlerNamespace }}
name: {{template "handlerPrefix" .}}nmstate-webhook
spec:
minAvailable: {{ .WebhookMinReplicas }}
selector:
matchLabels:
name: {{template "handlerPrefix" .}}nmstate-webhook
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
openshift.io/cluster-monitoring: ""
prometheus.nmstate.io: "true"
name: controller-manager-metrics-monitor
namespace: {{ .HandlerNamespace }}
spec:
endpoints:
- scheme: https
port: metrics
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
tlsConfig:
insecureSkipVerify: true
metricRelabelings:
- action: labeldrop
regex: instance
- action: labeldrop
regex: job
relabelings:
- action: labeldrop
regex: pod
- action: labeldrop
regex: container
- action: labeldrop
regex: endpoint
namespaceSelector:
matchNames:
- {{ .HandlerNamespace }}
selector:
matchLabels:
prometheus.nmstate.io: "true"
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: prometheus-k8s
namespace: {{ .HandlerNamespace }}
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- pods
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: prometheus-k8s
namespace: {{ .HandlerNamespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: prometheus-k8s
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: {{ .MonitoringNamespace }}