mirror of https://git.rancher.io/charts
21 lines
772 B
YAML
21 lines
772 B
YAML
{{- if and .Values.prometheus.enabled .Values.global.rbac.create .Values.global.rbac.pspEnabled }}
|
|
kind: ClusterRole
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
metadata:
|
|
name: {{ template "kube-prometheus-stack.fullname" . }}-prometheus-psp
|
|
labels:
|
|
app: {{ template "kube-prometheus-stack.name" . }}-prometheus
|
|
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
|
rules:
|
|
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }}
|
|
{{- if semverCompare "> 1.15.0-0" $kubeTargetVersion }}
|
|
- apiGroups: ['policy']
|
|
{{- else }}
|
|
- apiGroups: ['extensions']
|
|
{{- end }}
|
|
resources: ['podsecuritypolicies']
|
|
verbs: ['use']
|
|
resourceNames:
|
|
- {{ template "kube-prometheus-stack.fullname" . }}-prometheus
|
|
{{- end }}
|