mirror of https://git.rancher.io/charts
23 lines
828 B
YAML
23 lines
828 B
YAML
|
{{- if and .Values.podSecurityPolicy.enabled .Values.rbac.create -}}
|
||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||
|
kind: ClusterRole
|
||
|
metadata:
|
||
|
labels:
|
||
|
app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }}
|
||
|
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||
|
name: psp-{{ template "kube-state-metrics.fullname" . }}
|
||
|
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-state-metrics.fullname" . }}
|
||
|
{{- end }}
|