This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support multiple services (#10)
- Support multiple services - Warning about migration of a single service port to multiple service ports - Change `appIngressroute` to `appingressroutes` - Update linter, add unit test - Support `helm status` get access address --------- Co-authored-by: Phil Chen <[email protected]>
- Loading branch information
Showing
12 changed files
with
270 additions
and
46 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
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,21 @@ | ||
{{ include "application-chart-template.fullname" . }} has been Installed! | ||
{{- if .Values.appIngressroute }} | ||
Use the link below to access the app: | ||
{{- range $host := .Values.applicationHosts }} | ||
{{- range $ingress := $.Values.appIngressroute }} | ||
{{ empty $.Values.applicationTLS | ternary "http" "https" }}://{{ $host }}{{ $ingress.path }} | ||
{{- end }} | ||
{{- end }} | ||
Warnig: Migrate the `.Values.appIngressroute` variable to `.Values.appIngressroutes` | ||
{{- end }} | ||
{{- if .Values.appIngressroutes }} | ||
Use the link below to access the app: | ||
{{- range $host := .Values.applicationHosts }} | ||
{{- range $ingress := $.Values.appIngressroute }} | ||
{{ empty $.Values.applicationTLS | ternary "http" "https" }}://{{ $host }}{{ $ingress.path }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- if .Values.service.port }} | ||
Warnig: Migrate the `.Values.service.port` (object) variable to `.Values.service.ports` (list) | ||
{{- 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
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,58 @@ | ||
{{/* | ||
Host for access rule | ||
*/}} | ||
{{- define "application-chart-template.applicationHosts" -}} | ||
{{- $hosts := .Values.applicationHosts }} | ||
{{- $orOperator := " || " }} | ||
{{- $ruleHosts := list }} | ||
{{- range $_, $host := $hosts }} | ||
{{- $ruleHosts = append $ruleHosts (printf "Host(`%s`)" $host) }} | ||
{{- end }} | ||
{{- printf "(%s)" (join $orOperator $ruleHosts) }} | ||
{{- end }} | ||
|
||
{{/* | ||
Middlewares for web ingress-routes | ||
*/}} | ||
{{- define "application-chart-template.webMiddlewares" -}} | ||
{{- $webMiddlewares := list "compress" "strip-prefix" }} | ||
{{- if $.Values.applicationTLS }} | ||
{{- $webMiddlewares = append $webMiddlewares "redirect-to-https" }} | ||
{{- end }} | ||
{{- if $.Values.corsSettings }} | ||
{{- $webMiddlewares = append $webMiddlewares "cors" }} | ||
{{- end }} | ||
{{- range $webMiddlewares }} | ||
- name: {{ include "application-chart-template.fullname" $ }}-{{ . }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Middlewares for websecure ingress-routes | ||
*/}} | ||
{{- define "application-chart-template.websecureMiddlewares" -}} | ||
{{- $websecureMiddlewares := list "compress" "strip-prefix" }} | ||
{{- if $.Values.corsSettings }} | ||
{{- $websecureMiddlewares = append $websecureMiddlewares "cors" }} | ||
{{- end }} | ||
{{- range $websecureMiddlewares }} | ||
- name: {{ include "application-chart-template.fullname" $ }}-{{ . }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Renders the ingress service port value | ||
*/}} | ||
{{- define "application-chart-template.ingressServicePort" -}} | ||
{{- $portName := "" -}} | ||
{{- range $port := .ports -}} | ||
{{- if eq $.servicePortName $port.name -}} | ||
{{- $portName = $.servicePortName -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- if $portName -}} | ||
{{- printf "%s" $portName -}} | ||
{{- else -}} | ||
{{- fail "The same service port name could not be found!" -}} | ||
{{- end -}} | ||
{{- 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
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
Oops, something went wrong.