Skip to content

Commit b948363

Browse files
committed
allow to disable cluster roles
1 parent 621ad02 commit b948363

2 files changed

Lines changed: 19 additions & 17 deletions

File tree

helm/robusta/templates/runner-service-account.yaml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
name: {{ include "robusta.fullname" . }}-runner-service-account
5+
namespace: {{ .Release.Namespace }}
6+
{{- if .Values.runnerServiceAccount.annotations }}
7+
annotations:
8+
{{- with .Values.runnerServiceAccount.annotations }}
9+
{{- toYaml . | nindent 4}}
10+
{{- end }}
11+
{{- end }}
12+
{{- if .Values.runnerServiceAccount.imagePullSecrets }}
13+
imagePullSecrets:
14+
{{- toYaml .Values.runnerServiceAccount.imagePullSecrets | nindent 2}}
15+
{{- end }}
16+
{{- if .Values.runner.createClusterRole }}
17+
---
118
kind: ClusterRole
219
apiVersion: rbac.authorization.k8s.io/v1
320
metadata:
@@ -327,23 +344,6 @@ rules:
327344
- patch
328345
- update
329346
{{- end }}
330-
331-
---
332-
apiVersion: v1
333-
kind: ServiceAccount
334-
metadata:
335-
name: {{ include "robusta.fullname" . }}-runner-service-account
336-
namespace: {{ .Release.Namespace }}
337-
{{- if .Values.runnerServiceAccount.annotations }}
338-
annotations:
339-
{{- with .Values.runnerServiceAccount.annotations }}
340-
{{- toYaml . | nindent 4}}
341-
{{- end }}
342-
{{- end }}
343-
{{- if .Values.runnerServiceAccount.imagePullSecrets }}
344-
imagePullSecrets:
345-
{{- toYaml .Values.runnerServiceAccount.imagePullSecrets | nindent 2}}
346-
{{- end }}
347347
---
348348
apiVersion: rbac.authorization.k8s.io/v1
349349
kind: ClusterRoleBinding
@@ -357,6 +357,7 @@ subjects:
357357
- kind: ServiceAccount
358358
name: {{ include "robusta.fullname" . }}-runner-service-account
359359
namespace: {{ .Release.Namespace }}
360+
{{- end -}} # createClusterRole
360361
{{- if .Values.openshift.enabled }}
361362
---
362363
kind: ClusterRoleBinding

helm/robusta/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ runner:
697697
sentry_dsn: https://4f1a66f025c60830fec303a094dcdf94@o1120648.ingest.sentry.io/6156573
698698
sendAdditionalTelemetry: false
699699
certificate: "" # base64 encoded
700+
createClusterRole: true
700701
customServiceAccount: "" # to override the runner service account
701702
resources:
702703
requests:

0 commit comments

Comments
 (0)