rancher-charts/charts/rancher-project-monitoring/0.2.0+up0.2.1/templates/prometheus/psp-clusterrole.yaml

21 lines
787 B
YAML

{{- if and .Values.prometheus.enabled .Values.global.rbac.create .Values.global.cattle.psp.enabled }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "project-prometheus-stack.fullname" . }}-prometheus-psp
labels:
app: {{ template "project-prometheus-stack.name" . }}-prometheus
{{ include "project-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 "project-prometheus-stack.fullname" . }}-prometheus
{{- end }}