Updating ingress templates to use .values.inf.k8s.dns value instead of values.ingress.hosts
Updating names template to allow generation of external url values using dns prefix
This commit is contained in:
parent
84761fd7af
commit
519ecc5897
@ -5,7 +5,6 @@
|
|||||||
app: # app global settings
|
app: # app global settings
|
||||||
name: "my-eshop" # Override for custom app name
|
name: "my-eshop" # Override for custom app name
|
||||||
ingress: # ingress related settings
|
ingress: # ingress related settings
|
||||||
suffix: false # if true ingress endpoints are suffixed with .Values.appName value (or .Release.Name if the 1st do not exist)
|
|
||||||
entries:
|
entries:
|
||||||
basket: basket-api # ingress entry for basket api
|
basket: basket-api # ingress entry for basket api
|
||||||
catalog: catalog-api # ingress entry for catalog api
|
catalog: catalog-api # ingress entry for catalog api
|
||||||
|
@ -17,18 +17,22 @@
|
|||||||
{{- define "url-of" -}}
|
{{- define "url-of" -}}
|
||||||
{{- $name := first .}}
|
{{- $name := first .}}
|
||||||
{{- $ctx := last .}}
|
{{- $ctx := last .}}
|
||||||
{{- if $ctx.Values.app.ingress.suffix -}}
|
|
||||||
{{- $suffix := include "suffix-name" $ctx -}}
|
{{- $suffix := include "suffix-name" $ctx -}}
|
||||||
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}}
|
{{- if $ctx.Values.inf.k8s.dnsprefix -}}
|
||||||
|
{{- printf "%s.%s/%s" $suffix $ctx.Values.inf.k8s.dns $name -}} # Value is <prefix>.<dns>/<name>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}}
|
{{- if $ctx.Values.inf.k8s.suffix -}}
|
||||||
|
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}} # Value is <dns>/<name>-<sufix>
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} # Value is just <dns>/<name>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{ define "pathBase" -}}
|
{{ define "pathBase" -}}
|
||||||
{{- if .Values.app.ingress.suffix -}}
|
{{- if .Values.inf.k8s.suffix -}}
|
||||||
{{- $suffix := include "suffix-name" . -}}
|
{{- $suffix := include "suffix-name" . -}}
|
||||||
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
@ -19,20 +19,16 @@ spec:
|
|||||||
tls:
|
tls:
|
||||||
{{- range .Values.ingress.tls }}
|
{{- range .Values.ingress.tls }}
|
||||||
- hosts:
|
- hosts:
|
||||||
{{- range .hosts }}
|
- {{ .Values.inf.k8s.dns }}
|
||||||
- {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
secretName: {{ .secretName }}
|
secretName: {{ .secretName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
- host: {{ .Values.inf.k8s.dns }}
|
||||||
- host: {{ . }}
|
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: {{ $ingressPath }}
|
- path: {{ $ingressPath }}
|
||||||
backend:
|
backend:
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -17,18 +17,22 @@
|
|||||||
{{- define "url-of" -}}
|
{{- define "url-of" -}}
|
||||||
{{- $name := first .}}
|
{{- $name := first .}}
|
||||||
{{- $ctx := last .}}
|
{{- $ctx := last .}}
|
||||||
{{- if $ctx.Values.app.ingress.suffix -}}
|
|
||||||
{{- $suffix := include "suffix-name" $ctx -}}
|
{{- $suffix := include "suffix-name" $ctx -}}
|
||||||
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}}
|
{{- if $ctx.Values.inf.k8s.dnsprefix -}}
|
||||||
|
{{- printf "%s.%s/%s" $suffix $ctx.Values.inf.k8s.dns $name -}} # Value is <prefix>.<dns>/<name>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}}
|
{{- if $ctx.Values.inf.k8s.suffix -}}
|
||||||
|
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}} # Value is <dns>/<name>-<sufix>
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} # Value is just <dns>/<name>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{ define "pathBase" -}}
|
{{ define "pathBase" -}}
|
||||||
{{- if .Values.app.ingress.suffix -}}
|
{{- if .Values.inf.k8s.suffix -}}
|
||||||
{{- $suffix := include "suffix-name" . -}}
|
{{- $suffix := include "suffix-name" . -}}
|
||||||
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
@ -19,20 +19,16 @@ spec:
|
|||||||
tls:
|
tls:
|
||||||
{{- range .Values.ingress.tls }}
|
{{- range .Values.ingress.tls }}
|
||||||
- hosts:
|
- hosts:
|
||||||
{{- range .hosts }}
|
- {{ .Values.inf.k8s.dns }}
|
||||||
- {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
secretName: {{ .secretName }}
|
secretName: {{ .secretName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
- host: {{ .Values.inf.k8s.dns }}
|
||||||
- host: {{ . }}
|
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: {{ $ingressPath }}
|
- path: {{ $ingressPath }}
|
||||||
backend:
|
backend:
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -17,18 +17,22 @@
|
|||||||
{{- define "url-of" -}}
|
{{- define "url-of" -}}
|
||||||
{{- $name := first .}}
|
{{- $name := first .}}
|
||||||
{{- $ctx := last .}}
|
{{- $ctx := last .}}
|
||||||
{{- if $ctx.Values.app.ingress.suffix -}}
|
|
||||||
{{- $suffix := include "suffix-name" $ctx -}}
|
{{- $suffix := include "suffix-name" $ctx -}}
|
||||||
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}}
|
{{- if $ctx.Values.inf.k8s.dnsprefix -}}
|
||||||
|
{{- printf "%s.%s/%s" $suffix $ctx.Values.inf.k8s.dns $name -}} # Value is <prefix>.<dns>/<name>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}}
|
{{- if $ctx.Values.inf.k8s.suffix -}}
|
||||||
|
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}} # Value is <dns>/<name>-<sufix>
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} # Value is just <dns>/<name>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{ define "pathBase" -}}
|
{{ define "pathBase" -}}
|
||||||
{{- if .Values.app.ingress.suffix -}}
|
{{- if .Values.inf.k8s.suffix -}}
|
||||||
{{- $suffix := include "suffix-name" . -}}
|
{{- $suffix := include "suffix-name" . -}}
|
||||||
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
@ -19,20 +19,16 @@ spec:
|
|||||||
tls:
|
tls:
|
||||||
{{- range .Values.ingress.tls }}
|
{{- range .Values.ingress.tls }}
|
||||||
- hosts:
|
- hosts:
|
||||||
{{- range .hosts }}
|
- {{ .Values.inf.k8s.dns }}
|
||||||
- {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
secretName: {{ .secretName }}
|
secretName: {{ .secretName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
- host: {{ .Values.inf.k8s.dns }}
|
||||||
- host: {{ . }}
|
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: {{ $ingressPath }}
|
- path: {{ $ingressPath }}
|
||||||
backend:
|
backend:
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -28,6 +28,8 @@ inf:
|
|||||||
key: "" # App insights to use
|
key: "" # App insights to use
|
||||||
k8s: # inf.k8s defines Kubernetes cluster global config
|
k8s: # inf.k8s defines Kubernetes cluster global config
|
||||||
dns: "" # k8s external IP or DNS. Value MUST BE PROVIDED using --set (--set inf.k8s.dns=my-cluster-dns)
|
dns: "" # k8s external IP or DNS. Value MUST BE PROVIDED using --set (--set inf.k8s.dns=my-cluster-dns)
|
||||||
|
dnsprefix: true # If 'true' DNS values in ingress are prefixed using values.app.name. Note that this requires "externalDNS" to be running in k8s cluster. If true "inf.k8s.suffix" is ignored.
|
||||||
|
suffix: false # If 'true' URL values in ingress are suffixed using values.app.name. That do not require anything special in cluster and still allows many apps using same ingress controller. Ignored if inf.k8s.dnsprefix is true
|
||||||
misc: # inf.misc contains miscellaneous configuration related to infrastructure
|
misc: # inf.misc contains miscellaneous configuration related to infrastructure
|
||||||
useLoadTest: false # If running under loading test or not
|
useLoadTest: false # If running under loading test or not
|
||||||
useAzureStorage: false # If catalog api uses azure storage or not
|
useAzureStorage: false # If catalog api uses azure storage or not
|
||||||
|
@ -17,18 +17,22 @@
|
|||||||
{{- define "url-of" -}}
|
{{- define "url-of" -}}
|
||||||
{{- $name := first .}}
|
{{- $name := first .}}
|
||||||
{{- $ctx := last .}}
|
{{- $ctx := last .}}
|
||||||
{{- if $ctx.Values.app.ingress.suffix -}}
|
|
||||||
{{- $suffix := include "suffix-name" $ctx -}}
|
{{- $suffix := include "suffix-name" $ctx -}}
|
||||||
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}}
|
{{- if $ctx.Values.inf.k8s.dnsprefix -}}
|
||||||
|
{{- printf "%s.%s/%s" $suffix $ctx.Values.inf.k8s.dns $name -}} # Value is <prefix>.<dns>/<name>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}}
|
{{- if $ctx.Values.inf.k8s.suffix -}}
|
||||||
|
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}} # Value is <dns>/<name>-<sufix>
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} # Value is just <dns>/<name>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{ define "pathBase" -}}
|
{{ define "pathBase" -}}
|
||||||
{{- if .Values.app.ingress.suffix -}}
|
{{- if .Values.inf.k8s.suffix -}}
|
||||||
{{- $suffix := include "suffix-name" . -}}
|
{{- $suffix := include "suffix-name" . -}}
|
||||||
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
@ -19,20 +19,16 @@ spec:
|
|||||||
tls:
|
tls:
|
||||||
{{- range .Values.ingress.tls }}
|
{{- range .Values.ingress.tls }}
|
||||||
- hosts:
|
- hosts:
|
||||||
{{- range .hosts }}
|
- {{ .Values.inf.k8s.dns }}
|
||||||
- {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
secretName: {{ .secretName }}
|
secretName: {{ .secretName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
- host: {{ .Values.inf.k8s.dns }}
|
||||||
- host: {{ . }}
|
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: {{ $ingressPath }}
|
- path: {{ $ingressPath }}
|
||||||
backend:
|
backend:
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -17,18 +17,22 @@
|
|||||||
{{- define "url-of" -}}
|
{{- define "url-of" -}}
|
||||||
{{- $name := first .}}
|
{{- $name := first .}}
|
||||||
{{- $ctx := last .}}
|
{{- $ctx := last .}}
|
||||||
{{- if $ctx.Values.app.ingress.suffix -}}
|
|
||||||
{{- $suffix := include "suffix-name" $ctx -}}
|
{{- $suffix := include "suffix-name" $ctx -}}
|
||||||
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}}
|
{{- if $ctx.Values.inf.k8s.dnsprefix -}}
|
||||||
|
{{- printf "%s.%s/%s" $suffix $ctx.Values.inf.k8s.dns $name -}} # Value is <prefix>.<dns>/<name>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}}
|
{{- if $ctx.Values.inf.k8s.suffix -}}
|
||||||
|
{{- printf "%s/%s-%s" $ctx.Values.inf.k8s.dns $name $suffix -}} # Value is <dns>/<name>-<sufix>
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s/%s" $ctx.Values.inf.k8s.dns $name -}} # Value is just <dns>/<name>
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{{ define "pathBase" -}}
|
{{ define "pathBase" -}}
|
||||||
{{- if .Values.app.ingress.suffix -}}
|
{{- if .Values.inf.k8s.suffix -}}
|
||||||
{{- $suffix := include "suffix-name" . -}}
|
{{- $suffix := include "suffix-name" . -}}
|
||||||
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
{{- printf "%s-%s" .Values.pathBase $suffix -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
|
@ -19,20 +19,16 @@ spec:
|
|||||||
tls:
|
tls:
|
||||||
{{- range .Values.ingress.tls }}
|
{{- range .Values.ingress.tls }}
|
||||||
- hosts:
|
- hosts:
|
||||||
{{- range .hosts }}
|
- {{ .Values.inf.k8s.dns }}
|
||||||
- {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
secretName: {{ .secretName }}
|
secretName: {{ .secretName }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
- host: {{ .Values.inf.k8s.dns }}
|
||||||
- host: {{ . }}
|
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- path: {{ $ingressPath }}
|
- path: {{ $ingressPath }}
|
||||||
backend:
|
backend:
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: http
|
servicePort: http
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user