38 lines
1012 B
YAML
38 lines
1012 B
YAML
{{- if .Values.ingress.enabled -}}
|
|
{{- $serviceName := print .Release.Name "-" .Values.image.name }}
|
|
{{- $servicePort := print .Values.service.targetPort .Values.service.protocol | lower -}}
|
|
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ .Values.image.name }}
|
|
labels:
|
|
app: {{ .Values.image.name }}
|
|
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
|
|
heritage: {{ .Release.Service }}
|
|
release: {{ .Release.Name }}
|
|
{{- if .Values.ingress.annotations }}
|
|
annotations:
|
|
{{ toYaml .Values.ingress.annotations | indent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
{{- if .Values.ingress.tls }}
|
|
tls:
|
|
{{ toYaml .Values.ingress.tls | indent 4 }}
|
|
{{- end }}
|
|
rules:
|
|
{{- $path := .Values.ingress.path -}}
|
|
{{- range .Values.ingress.hostnames }}
|
|
- host: "{{ . }}"
|
|
http:
|
|
paths:
|
|
- path: {{ $path }}
|
|
pathType: Prefix
|
|
backend:
|
|
service:
|
|
name: {{ $serviceName }}
|
|
port:
|
|
name: {{ $servicePort }}
|
|
{{- end }}
|
|
{{- end -}}
|