{{- if .Values.ingress.enabled -}} {{- $fullName := include "eks-app-mesh-gateway.fullname" . -}} {{- $servicePort := .Values.service.port -}} {{- $ingressPath := .Values.ingress.path -}} {{- $defaultIngressPath := printf "/%s/*" $fullName -}} {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 {{- end }} kind: Ingress metadata: name: {{ $fullName }} labels: app: {{ template "eks-app-mesh-gateway.name" . }} chart: {{ template "eks-app-mesh-gateway.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- with .Values.ingress.annotations }} annotations: {{ toYaml . | indent 4 }} {{- end }} spec: {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - {{ . }} {{- end }} secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- if .Values.ingress.hosts }} {{- range .Values.ingress.hosts }} - host: {{ . }} http: paths: - path: {{ $ingressPath | default $defaultIngressPath }} backend: serviceName: {{ $fullName }} servicePort: {{ .Values.service.port | default 80 }} {{- end }} {{- else }} - http: paths: - path: {{ $ingressPath | default $defaultIngressPath }} backend: serviceName: {{ $fullName }} servicePort: {{ .Values.service.port | default 80 }} {{- end }} {{- end }}