rancher-partner-charts/charts/kubecost/cost-analyzer/1.106.3/templates/cost-analyzer-psp-role.temp...

24 lines
705 B
YAML

{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }}
{{- if .Values.podSecurityPolicy }}
{{- if .Values.podSecurityPolicy.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "cost-analyzer.fullname" . }}-psp
namespace: {{ .Release.Namespace }}
labels:
{{ include "cost-analyzer.commonLabels" . | nindent 4 }}
annotations:
{{- if .Values.podSecurityPolicy.annotations }}
{{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }}
{{- end }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "cost-analyzer.fullname" . }}-psp
{{- end }}
{{- end }}
{{- end }}