diff --git a/docker-plain/files/chart/templates/NOTES.txt b/docker-plain/files/chart/templates/NOTES.txt index 1708ecef..721ede54 100644 --- a/docker-plain/files/chart/templates/NOTES.txt +++ b/docker-plain/files/chart/templates/NOTES.txt @@ -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 }} diff --git a/docker-plain/files/chart/templates/ingress.yaml b/docker-plain/files/chart/templates/ingress.yaml index a2c5cb5c..14489e0f 100644 --- a/docker-plain/files/chart/templates/ingress.yaml +++ b/docker-plain/files/chart/templates/ingress.yaml @@ -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: diff --git a/docker-plain/files/chart/values.schema.json b/docker-plain/files/chart/values.schema.json index 6b06bc12..534aadd1 100644 --- a/docker-plain/files/chart/values.schema.json +++ b/docker-plain/files/chart/values.schema.json @@ -81,6 +81,10 @@ "type": "string" } }, + "simpleHost": { + "description": "Hostname for simple use cases", + "type": "string" + }, "hosts": { "description": "List of ingress hosts", "type": "array", diff --git a/docker-plain/files/chart/values.yaml b/docker-plain/files/chart/values.yaml index 01f88a17..b5c39caa 100644 --- a/docker-plain/files/chart/values.yaml +++ b/docker-plain/files/chart/values.yaml @@ -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..yaml rather than in this file. + simpleHost: "" hosts: [] # When defining a host you must define also a path # - host: yourapp.yourdomain.com # paths: