This repository has been archived on 2024-07-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
chart/templates/webhook-ingress.yaml

60 lines
2.0 KiB
YAML

{{- if .Values.webhook.ingress.enabled -}}
{{- $fullName := include "n8n.fullname" . -}}
{{- $svcPort := .Values.webhook.service.port -}}
{{- if and .Values.webhook.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.webhook.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.webhook.ingress.annotations "kubernetes.io/ingress.class" .Values.webhook.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}-webhook
labels:
{{- include "n8n.labels" . | nindent 4 }}
{{- with .Values.webhook.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.webhook.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.webhook.ingress.className }}
{{- end }}
{{- if .Values.webhook.ingress.tls }}
tls:
{{- range .Values.webhook.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.webhook.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ default "ImplementationSpecific" .pathType }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}