feat: add Ingress support

This commit is contained in:
a5r0n
2021-10-24 12:04:04 +03:00
parent 245cdac996
commit eb8397f871
3 changed files with 18 additions and 22 deletions
+1 -5
View File
@@ -1,10 +1,6 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.host }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "n8n.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
+15 -13
View File
@@ -1,11 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "n8n.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
@@ -27,15 +23,21 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
- host: {{ .Values.ingress.host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
- path: /
pathType: Prefix
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
service:
name: {{ include "n8n.fullname" . }}-main
port:
name: http
- path: /webhook/
pathType: Prefix
backend:
service:
name: {{ include "n8n.fullname" . }}-webhook
port:
name: http
{{- end }}
+2 -4
View File
@@ -81,14 +81,12 @@ service:
port: 80
ingress:
enabled: false
enabled: true
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
host: n8n.local
tls: []
# - secretName: chart-example-tls
# hosts: