feat(helm): Consider external proxy to generate URLs

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
rjshrjndrn 2023-10-25 18:57:29 +02:00
parent a712ab45e4
commit b4e614d867
2 changed files with 17 additions and 2 deletions

View file

@ -8,8 +8,19 @@ Expand the name of the chart.
{{/* Get domain name with/without port */}}
{{- define "openreplay.domainURL" -}}
{{- $scheme := ternary "https" "http" .Values.global.ORSecureAccess -}}
{{- $port := toString (ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess) -}}
{{- if or (eq $port "80") (eq $port "443") -}}
{{- $internalPort := ternary .Values.global.ingress.controller.service.ports.https .Values.global.ingress.controller.service.ports.http .Values.global.ORSecureAccess -}}
{{/* If you're running OR behind proxy
ingress-nginx: &ingress-nginx
externalProxyPorts:
http: 80
https: 443
*/}}
{{- $externalPort := $internalPort -}}
{{- if .Values.global.ingress.externalProxyPorts }}
{{- $externalPort = ternary .Values.global.ingress.externalProxyPorts.https .Values.global.ingress.externalProxyPorts.http .Values.global.ORSecureAccess -}}
{{- end }}
{{- $port := toString $externalPort -}}
{{- if or (eq $port "80") (eq $port "443") -}}
{{- printf "%s://%s" $scheme .Values.global.domainName -}}
{{- else -}}
{{- printf "%s://%s:%s" $scheme .Values.global.domainName $port -}}

View file

@ -65,6 +65,10 @@ minio:
secretKey: "changeMeMinioPassword"
ingress-nginx: &ingress-nginx
# If you're using an external proxy in front of OpenReplay, update the proxy ports below.
# externalProxyPorts:
# http: 80
# https: 443
controller:
ingressClassResource:
# -- Name of the ingressClass