{{- if .Values.ingress.enabled -}} {{- $serviceName := include "artifactory-ha.fullname" . -}} {{- $servicePort := .Values.artifactory.externalPort -}} apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ template "artifactory-ha.fullname" . }} labels: app: {{ template "artifactory-ha.name" . }} chart: {{ template "artifactory-ha.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} {{- if .Values.ingress.annotations }} annotations: {{ .Values.ingress.annotations | toYaml | trimSuffix "\n" | indent 4 -}} {{- end }} spec: {{- if .Values.ingress.defaultBackend.enabled }} backend: serviceName: {{ $serviceName }} servicePort: {{ $servicePort }} {{- end -}} {{- if .Values.ingress.hosts }} rules: {{- range $host := .Values.ingress.hosts }} - host: {{ $host | quote }} http: paths: - path: / backend: serviceName: {{ $serviceName }} servicePort: {{ $servicePort }} {{- end -}} {{- end -}} {{- if .Values.ingress.tls }} tls: {{ toYaml .Values.ingress.tls | indent 4 }} {{- end -}} {{- end -}}