feat(common): add autolinking opion to ingress (#1922)

* feat(common): add autolinking opion to ingress

* bump
This commit is contained in:
Kjeld Schouten-Lebbing 2022-02-21 17:16:29 +01:00 committed by GitHub
parent 8df0ccb4ad
commit 27b038e2d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 1 deletions

View File

@ -8,6 +8,12 @@ service:
ports:
main:
port: 8080
autolink:
enabled: true
ports:
autolink:
enabled: true
port: 8081
args:
- --port
@ -71,6 +77,21 @@ ingress:
port:
tls: []
autolink:
enabled: true
fixedMiddlewares:
- chain-basic
hosts:
- host: label.chart-example.local
paths:
- path: /
pathType: Prefix
service:
name:
port:
tls: []
autoLink: true
labellist:
enabled: true
nameOverride:

View File

@ -15,4 +15,4 @@ maintainers:
name: common
sources: null
type: library
version: 8.15.4
version: 8.16.0

View File

@ -18,12 +18,20 @@ within the common library.
{{- end -}}
{{- $primaryService := get .Values.service (include "common.service.primary" .) -}}
{{- $autoLinkService := get .Values.service (include "common.service.primary" .) -}}
{{- $defaultServiceName := $fullName -}}
{{- if and (hasKey $primaryService "nameOverride") $primaryService.nameOverride -}}
{{- $defaultServiceName = printf "%v-%v" $defaultServiceName $primaryService.nameOverride -}}
{{- end -}}
{{- $defaultServicePort := get $primaryService.ports (include "common.classes.service.ports.primary" (dict "values" $primaryService)) -}}
{{- if and (hasKey $values "nameOverride") ( $values.nameOverride ) ( $values.autoLink ) -}}
{{- $autoLinkService = get .Values.service $values.nameOverride -}}
{{- $defaultServiceName = $ingressName -}}
{{- $defaultServicePort = get $autoLinkService.ports $values.nameOverride -}}
{{- end -}}
{{- $isStable := include "common.capabilities.ingress.isStable" . }}
{{- $mddwrNamespace := "default" }}

View File

@ -530,6 +530,9 @@ ingress:
# -- Override the name suffix that is used for this ingress.
nameOverride:
# -- Autolink the ingress to a service and port, both with the same name as the ingress.
autoLink: false
# -- disable to ignore any default middlwares
enableFixedMiddlewares: true