{{- if .Values.rbac.create }} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "nginx-ingress.serviceAccountName" . }} {{- if .Values.controller.serviceAccount.annotations }} annotations: {{- toYaml .Values.controller.serviceAccount.annotations | nindent 4 }} {{- end }} namespace: {{ .Release.Namespace }} labels: {{- include "nginx-ingress.labels" . | nindent 4 }} {{- if .Values.controller.serviceAccount.imagePullSecretName }} imagePullSecrets: - name: {{ .Values.controller.serviceAccount.imagePullSecretName }} {{- end }} {{- end }}