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: ...@@ -11,10 +11,8 @@ metadata:
{{- include "common.labels" . | nindent 4 }} {{- include "common.labels" . | nindent 4 }}
spec: spec:
ingressClassName: {{ .Values.ingressClassName }} ingressClassName: {{ .Values.ingressClassName }}
rules: rules:
{{- .Values.rules | toYaml | nindent 4 }} {{- (include "common.extra-ingress.rules" .) | nindent 4 }}
{{- with .Values.tls }} tls:
tls: {{- (include "common.extra-ingress.tls" .) | nindent 4 }}
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- end }} {{- end }}
...@@ -15,3 +15,29 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} ...@@ -15,3 +15,29 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }} {{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }} {{- 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: ...@@ -2,7 +2,8 @@ extraIngress:
name: extra-ingress # Default value name: extra-ingress # Default value
ingressClassName: traefik ingressClassName: traefik
rules: rules:
- host: test.com default:
host: test.com
http: http:
paths: paths:
- path: / - path: /
...@@ -11,6 +12,7 @@ extraIngress: ...@@ -11,6 +12,7 @@ extraIngress:
serviceName: webservice serviceName: webservice
servicePort: 8080 servicePort: 8080
tls: tls:
- hosts: default:
hosts:
- test.com - test.com
secretName: test-tls 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