Skip to content

Commit

Permalink
docker-plain: add simpleHost to chart/values.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
faust2199 committed Nov 28, 2024
1 parent e3e6552 commit 167397b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docker-plain/files/chart/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Component '{{ include "chart.fullname" . }}' on version '{{ .Values.imageTag }}' released with Helm!
{{- if .Values.ingress.enabled }}
The component is exposed via the following routes:
{{- $appUrl := .Values.appUrl -}}
{{- if .Values.ingress.simpleHost }}
{{ printf "https://%s" .Values.ingress.simpleHost }}
{{- end }}
{{- range .Values.ingress.hosts }}
{{ printf "https://%s" .host }}
{{- end }}
Expand Down
12 changes: 12 additions & 0 deletions docker-plain/files/chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ spec:
- {}
{{- end }}
rules:
{{- if .Values.ingress.simpleHost }}
- host: {{ .Values.ingress.simpleHost | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
{{- end }}
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
Expand Down
4 changes: 4 additions & 0 deletions docker-plain/files/chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
"type": "string"
}
},
"simpleHost": {
"description": "Hostname for simple use cases",
"type": "string"
},
"hosts": {
"description": "List of ingress hosts",
"type": "array",
Expand Down
4 changes: 4 additions & 0 deletions docker-plain/files/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ ingress:
## e.g. add cert-manager support by annotating the ingress https://cert-manager.io/docs/usage/ingress/
## ask in your company for good defaults

# If no more than one URL is needed, simpleHost is probably sufficient. Alternatively, Use hosts for more customization capabilities.
# simpleHost and hosts can coexist. Check out templates/ingress.yaml for more details.
# Usually we want different URLs for dev, test and prod environments. It makes sense to define them in values.<env>.yaml rather than in this file.
simpleHost: ""
hosts: [] # When defining a host you must define also a path
# - host: yourapp.yourdomain.com
# paths:
Expand Down

0 comments on commit 167397b

Please sign in to comment.