[FEAT] can configure ingress default path
Signed-off-by: Guillaume Calmettes <gcalmettes@idmog.com>
This commit is contained in:
parent
eedcf15a9c
commit
bf7f917299
2 changed files with 36 additions and 19 deletions
|
@ -2,6 +2,8 @@
|
||||||
{{- if .Values.server.ingress.enabled -}}
|
{{- if .Values.server.ingress.enabled -}}
|
||||||
{{- $serviceName := printf "%s-%s" .Release.Name .Values.server.name -}}
|
{{- $serviceName := printf "%s-%s" .Release.Name .Values.server.name -}}
|
||||||
{{- $servicePort := .Values.server.servicePort -}}
|
{{- $servicePort := .Values.server.servicePort -}}
|
||||||
|
{{- $paths := .Values.server.ingress.paths -}}
|
||||||
|
{{- $extraPaths := .Values.server.ingress.extraPaths -}}
|
||||||
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
|
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
{{ else }}
|
{{ else }}
|
||||||
|
@ -23,24 +25,37 @@ metadata:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.server.ingress.hosts }}
|
{{- if .Values.server.ingress.hosts }}
|
||||||
- host: {{ . }}
|
{{- range $host := .Values.server.ingress.hosts }}
|
||||||
|
- host: {{ $host }}
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
{{- if $.Values.server.ingress.paths }}
|
{{- if $extraPaths }}
|
||||||
{{- range $.Values.server.ingress.paths }}
|
{{- toYaml $extraPaths | nindent 10 }}
|
||||||
- backend:
|
{{- end }}
|
||||||
serviceName: {{ .serviceName }}
|
{{- range $p := $paths }}
|
||||||
servicePort: {{ .servicePort }}
|
- path: {{ $p }}
|
||||||
{{- end }}
|
backend:
|
||||||
{{- end }}
|
|
||||||
- backend:
|
|
||||||
serviceName: {{ $serviceName }}
|
serviceName: {{ $serviceName }}
|
||||||
servicePort: {{ $servicePort }}
|
servicePort: {{ $servicePort }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- else }}
|
||||||
|
- http:
|
||||||
|
paths:
|
||||||
|
{{- if $extraPaths }}
|
||||||
|
{{- toYaml $extraPaths | nindent 10 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- range $p := $paths }}
|
||||||
|
- path: {{ $p }}
|
||||||
|
backend:
|
||||||
|
serviceName: {{ $serviceName }}
|
||||||
|
servicePort: {{ $servicePort }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
{{- if .Values.server.ingress.tls }}
|
{{- if .Values.server.ingress.tls }}
|
||||||
tls:
|
tls:
|
||||||
{{ toYaml .Values.server.ingress.tls | indent 4 }}
|
{{- toYaml .Values.server.ingress.tls | nindent 4 }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -219,7 +219,6 @@ server:
|
||||||
##
|
##
|
||||||
ingress:
|
ingress:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
## Annotations to be added to the web ingress.
|
## Annotations to be added to the web ingress.
|
||||||
##
|
##
|
||||||
# annotations:
|
# annotations:
|
||||||
|
@ -234,13 +233,16 @@ server:
|
||||||
## Hostnames.
|
## Hostnames.
|
||||||
## Must be provided if Ingress is enabled.
|
## Must be provided if Ingress is enabled.
|
||||||
##
|
##
|
||||||
# hosts:
|
hosts: []
|
||||||
# - argo.domain.com
|
# - argocd.example.com
|
||||||
|
paths:
|
||||||
|
- /
|
||||||
## Additional Paths for each host
|
## Additional Paths for each host
|
||||||
# paths:
|
extraPaths: []
|
||||||
# - serviceName: "ssl-redirect"
|
# - path: /*
|
||||||
# servicePort: "use-annotation"
|
# backend:
|
||||||
|
# serviceName: ssl-redirect
|
||||||
|
# servicePort: use-annotation
|
||||||
|
|
||||||
## TLS configuration.
|
## TLS configuration.
|
||||||
## Secrets must be manually created in the namespace.
|
## Secrets must be manually created in the namespace.
|
||||||
|
|
Loading…
Reference in a new issue