From b4e614d867cf67023dea17845d5586f2963bef63 Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Wed, 25 Oct 2023 18:57:29 +0200 Subject: [PATCH] feat(helm): Consider external proxy to generate URLs Signed-off-by: rjshrjndrn --- .../helmcharts/openreplay/templates/_helpers.tpl | 15 +++++++++++++-- scripts/helmcharts/vars.yaml | 4 ++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index 0da826690..38ec6a459 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -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 -}} diff --git a/scripts/helmcharts/vars.yaml b/scripts/helmcharts/vars.yaml index 4b3a16962..1935f8c38 100644 --- a/scripts/helmcharts/vars.yaml +++ b/scripts/helmcharts/vars.yaml @@ -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