rancher-partner-charts/charts/hashicorp/consul/templates/ingress-gateways-serviceacc...

36 lines
1.1 KiB
YAML

{{- if .Values.ingressGateways.enabled }}
{{- $root := . }}
{{- $defaults := .Values.ingressGateways.defaults }}
{{- range .Values.ingressGateways.gateways }}
{{- $serviceAccount := .serviceAccount }}
apiVersion: v1
kind: ServiceAccount
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 }}
{{- if (or $defaults.serviceAccount.annotations $serviceAccount.annotations) }}
annotations:
{{- if $defaults.serviceAccount.annotations }}
{{ tpl $defaults.serviceAccount.annotations $root | nindent 4 | trim }}
{{- end }}
{{- if $serviceAccount.annotations }}
{{ tpl $serviceAccount.annotations $root | nindent 4 | trim }}
{{- end }}
{{- end }}
{{- with $root.Values.global.imagePullSecrets }}
imagePullSecrets:
{{- range . }}
- name: {{ .name }}
{{- end }}
{{- end }}
---
{{- end }}
{{- end }}