-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: support for a simple ingress in docs and a flexible ingress temp…
…late
- Loading branch information
1 parent
ac2ca13
commit 499b6f2
Showing
5 changed files
with
156 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{{/* Renders the Ingress objects required by the chart */}} | ||
{{- define "common.ingress" -}} | ||
{{- /* Generate named ingresses as required */ -}} | ||
{{- range $name, $ingress := .Values.ingress }} | ||
{{- if $ingress.enabled -}} | ||
{{- $ingressValues := $ingress -}} | ||
|
||
{{/* set defaults */}} | ||
{{- if and (not $ingressValues.nameOverride) (ne $name (include "common.ingress.primary" $)) -}} | ||
{{- $_ := set $ingressValues "nameOverride" $name -}} | ||
{{- end -}} | ||
|
||
{{- $_ := set $ "ObjectValues" (dict "ingress" $ingressValues) -}} | ||
{{- include "common.classes.ingress" $ }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* Return the name of the primary ingress object */}} | ||
{{- define "common.ingress.primary" -}} | ||
{{- $enabledIngresses := dict -}} | ||
{{- range $name, $ingress := .Values.ingress -}} | ||
{{- if $ingress.enabled -}} | ||
{{- $_ := set $enabledIngresses $name . -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- $result := "" -}} | ||
{{- range $name, $ingress := $enabledIngresses -}} | ||
{{- if and (hasKey $ingress "primary") $ingress.primary -}} | ||
{{- $result = $name -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- if not $result -}} | ||
{{- $result = keys $enabledIngresses | first -}} | ||
{{- end -}} | ||
{{- $result -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ include "common.ingress" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters