diff --git a/n8n/templates/ingress.yaml b/n8n/templates/ingress.yaml new file mode 100644 index 0000000..39948a9 --- /dev/null +++ b/n8n/templates/ingress.yaml @@ -0,0 +1,46 @@ +{{- if .Values.ingress.enabled }} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: n8n + annotations: + {{- if eq .Values.ingress.className "nginx" }} + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" + nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" + nginx.ingress.kubernetes.io/configuration-snippet: | + more_set_headers "X-Frame-Options: SAMEORIGIN"; + proxy_set_header Accept-Encoding ""; + {{- end }} + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + ingressClassName: {{ .Values.ingress.className }} + rules: + - host: {{ .Values.n8n.domainName }} + http: + paths: + {{- if eq .Values.n8n.deploymentMode "scale" }} + - path: /webhook/ + pathType: Prefix + backend: + service: + name: webhook + port: + number: 5678 + - path: /webhook-waiting/ + pathType: Prefix + backend: + service: + name: webhook + port: + number: 5678 + {{- end }} + - path: / + pathType: Prefix + backend: + service: + name: n8n + port: + number: 5678 +{{- end }} diff --git a/n8n/values.yaml b/n8n/values.yaml index 8c14ef4..3b45fcc 100644 --- a/n8n/values.yaml +++ b/n8n/values.yaml @@ -10,5 +10,18 @@ n8n: password: change-this concurrency: 20 +ingress: + enabled: false + className: nginx + annotations: {} + # + # Traefik ingress example + # + # className: traefik + # annotations: + # traefik.ingress.kubernetes.io/router.entrypoints: websecure + # traefik.ingress.kubernetes.io/router.tls: "true" + # traefik.ingress.kubernetes.io/router.tls.certresolver: le + resources: memoryLimit: 1Gi