{{- if .Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy" }} {{- if .Values.podSecurityPolicy }} {{- if .Values.podSecurityPolicy.enabled }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ template "cost-analyzer.fullname" . }}-psp namespace: {{ .Release.Namespace }} labels: {{ include "cost-analyzer.commonLabels" . | nindent 6 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ template "cost-analyzer.fullname" . }}-psp subjects: - kind: ServiceAccount name: {{ template "cost-analyzer.serviceAccountName" . }} namespace: {{ .Release.Namespace }} {{- end }} {{- end }} {{- end }}