# helm_charts_psp-halyard-rolebinding.yaml
{{- if .Values.rbac.pspEnabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ template "spinnaker.fullname" . }}-halyard-psp
  labels:
{{ include "spinnaker.standard-labels" . | indent 4 }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: {{ template "spinnaker.fullname" . }}-halyard-psp
subjects:
- kind: ServiceAccount
  {{- if .Values.serviceAccount.halyardName }}
  name: {{ .Values.serviceAccount.halyardName }}
  {{- else }}
  name: {{ template "spinnaker.fullname" . }}-halyard
  {{- end }}
  namespace: {{ .Release.Namespace }}
{{- end }}