Skip to content
Snippets Groups Projects
Commit 2d54e82c authored by Andri Joos's avatar Andri Joos :blush:
Browse files

use maps instead of lists for rules & tls to allow overriding

parent d8293d50
No related branches found
No related tags found
No related merge requests found
Pipeline #7701 passed with stages
in 36 seconds
......@@ -11,10 +11,8 @@ metadata:
{{- include "common.labels" . | nindent 4 }}
spec:
ingressClassName: {{ .Values.ingressClassName }}
rules:
{{- .Values.rules | toYaml | nindent 4 }}
{{- with .Values.tls }}
tls:
{{- . | toYaml | nindent 4 }}
{{- end }}
rules:
{{- (include "common.extra-ingress.rules" .) | nindent 4 }}
tls:
{{- (include "common.extra-ingress.tls" .) | nindent 4 }}
{{- end }}
......@@ -15,3 +15,29 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Extra Ingress
*/}}
{{/*
Extra Ingress Rules
*/}}
{{- define "common.extra-ingress.rules" -}}
{{- $rules := list -}}
{{- range $name, $rule := .Values.rules -}}
{{- $rules = append $rules $rule -}}
{{- end }}
{{- toYaml $rules -}}
{{- end }}
{{/*
Extra Ingress TLS
*/}}
{{- define "common.extra-ingress.tls" -}}
{{- $tlsDefinitions := list -}}
{{- range $name, $tlsDefinition := .Values.tls -}}
{{- $tlsDefinitions = append $tlsDefinitions $tlsDefinition -}}
{{- end }}
{{- toYaml $tlsDefinitions -}}
{{- end }}
......@@ -2,7 +2,8 @@ extraIngress:
name: extra-ingress # Default value
ingressClassName: traefik
rules:
- host: test.com
default:
host: test.com
http:
paths:
- path: /
......@@ -11,6 +12,7 @@ extraIngress:
serviceName: webservice
servicePort: 8080
tls:
- hosts:
default:
hosts:
- test.com
secretName: test-tls
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment