blob: 0b85f3f106452ffeaa626e9a65a9ba5d9c6777ea [file] [log] [blame]
Oleksandr K.88f72a22024-07-25 14:03:19 +02001{{- if or .Values.podSecurityPolicy.enabled (not .Values.rbac.clusterscoped) }}
2kind: Role
3apiVersion: rbac.authorization.k8s.io/v1
4metadata:
5 name: {{ include "goldpinger.fullname" . }}-pod-security-policy
6 labels:
7 {{- include "goldpinger.labels" . | nindent 4 }}
8rules:
9{{- if not .Values.rbac.clusterscoped }}
10 - apiGroups: [""]
11 resources: ["pods"]
12 verbs: ["list"]
13{{- end }}
14{{- if .Values.podSecurityPolicy.enabled }}
15 - apiGroups: ["extensions"]
16 resources: ["podsecuritypolicies"]
17 resourceNames: [{{ .Values.podSecurityPolicy.policyName | quote }}]
18 verbs: ["use"]
19{{- end }}
20{{- end }}