{{- if .Values.ingressGateways.enabled }} {{- $root := . }} {{- range .Values.ingressGateways.gateways }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ template "consul.fullname" $root }}-{{ .name }} namespace: {{ $root.Release.Namespace }} labels: app: {{ template "consul.name" $root }} chart: {{ template "consul.chart" $root }} heritage: {{ $root.Release.Service }} release: {{ $root.Release.Name }} component: ingress-gateway ingress-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ template "consul.fullname" $root }}-{{ .name }} subjects: - kind: ServiceAccount name: {{ template "consul.fullname" $root }}-{{ .name }} --- {{- end }} {{- end }}