{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
  name: {{ template "contour.fullname" . }}
  labels:
    app.kubernetes.io/name: contour
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    helm.sh/chart: {{ include "contour.chart" . }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ template "contour.fullname" . }}
subjects:
- kind: ServiceAccount
  name: {{ template "contour.fullname" . }}
  namespace: {{ .Release.Namespace }}
{{- end -}}
