blob: 062e8f39ffef89d13918efaf9fd7f636344ebf94 [file] [log] [blame]
gio07eb1082024-10-25 14:35:56 +04001{{- /*
2Copyright Broadcom, Inc. All Rights Reserved.
3SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6{{- if .Values.rbac.create }}
7apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }}
8kind: Role
9metadata:
10 name: {{ include "mongodb.fullname" . }}
11 namespace: {{ include "mongodb.namespace" . | quote }}
12 labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
13rules:
14 - apiGroups:
15 - ""
16 resources:
17 - services
18 verbs:
19 - get
20 - list
21 - watch
22{{- if .Values.rbac.rules }}
23{{- include "common.tplvalues.render" ( dict "value" .Values.rbac.rules "context" $ ) | nindent 2 }}
24{{- end -}}
25{{- if and (include "common.capabilities.psp.supported" .) .Values.podSecurityPolicy.create }}
26 - apiGroups: ['{{ template "podSecurityPolicy.apiGroup" . }}']
27 resources: ['podsecuritypolicies']
28 verbs: ['use']
29 resourceNames: [{{ include "mongodb.fullname" . }}]
30{{- end -}}
31{{- end }}