improwised-charts/experimental/n8n-helm/templates/ingress.yaml

54 lines
1.5 KiB
YAML

{{- if .Values.ingress.enabled }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "n8n-helm.fullname" . }}-ingress
labels:
{{- include "n8n-helm.common.labels.standard" . | nindent 4 }}
annotations:
{{- if .Values.ingress.tls }}
ingress.kubernetes.io/secure-backends: "true"
{{- if .Values.ingress.certManager }}
kubernetes.io/tls-acme: "true"
{{- end }}
{{- end }}
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- if .Values.commonannotations }}
{{- range $key, $value := .Values.commonannotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
rules:
{{- if .Values.ingress.hostname }}
- host: {{ .Values.ingress.hostname }}
http:
paths:
- path: /
backend:
serviceName: "{{ template "n8n-helm.fullname" . }}-service"
servicePort: {{ .Values.service.port }}
{{- else }}
- http:
paths:
- path: /
backend:
serviceName: "{{ template "n8n-helm.fullname" . }}-service"
servicePort: {{ .Values.service.port }}
{{- end }}
{{- range .Values.ingress.hosts }}
- host: {{ .name }}
http:
paths:
- path: {{ default "/" .path }}
backend:
serviceName: "{{ template "n8n-helm.fullname" . }}-service"
servicePort: {{ $.Values.service.port }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end }}
{{- end }}