From 70dda4032a363038b9c0503f2f5003f664158e9b Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Tue, 27 May 2025 13:06:56 +0200 Subject: [PATCH] feat: add FQDN and path template to assist URL helper - Replace simple hostnames with fully qualified domain names - Include namespace and cluster domain in assist service URLs - Add /assist/%s path pattern for both enterprise and standard editions - Ensures proper service discovery across Kubernetes namespaces Signed-off-by: rjshrjndrn --- .../charts/assist/templates/ingress.yaml | 19 ------------------- .../charts/chalice/templates/deployment.yaml | 2 +- .../openreplay/templates/_helpers.tpl | 4 ++-- 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml b/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml index 41436c679..df355cefe 100644 --- a/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml +++ b/scripts/helmcharts/openreplay/charts/assist/templates/ingress.yaml @@ -10,25 +10,6 @@ metadata: {{- include "assist.labels" . | nindent 4 }} annotations: nginx.ingress.kubernetes.io/rewrite-target: /$1 - nginx.ingress.kubernetes.io/configuration-snippet: | - #set $sticky_used "no"; - #if ($sessionid != "") { - # set $sticky_used "yes"; - #} - - #add_header X-Debug-Session-ID $sessionid; - #add_header X-Debug-Session-Type "wss"; - #add_header X-Sticky-Session-Used $sticky_used; - #add_header X-Upstream-Server $upstream_addr; - - proxy_hide_header access-control-allow-headers; - proxy_hide_header Access-Control-Allow-Origin; - add_header 'Access-Control-Allow-Origin' $http_origin always; - add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always; - add_header 'Access-Control-Allow-Headers' 'sessionid, Content-Type, Authorization' always; - add_header 'Access-Control-Max-Age' 1728000; - add_header 'Content-Type' 'text/plain charset=UTF-8'; - nginx.ingress.kubernetes.io/upstream-hash-by: $sessionid {{- with .Values.ingress.annotations }} diff --git a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml index 3d86796a7..f690fcb33 100644 --- a/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml +++ b/scripts/helmcharts/openreplay/charts/chalice/templates/deployment.yaml @@ -59,7 +59,7 @@ spec: - name: sourcemaps_reader value: "http://sourcemapreader-openreplay.{{.Release.Namespace}}.{{.Values.global.clusterDomain}}:9000/%s/sourcemaps" - name: ASSIST_URL - value: "http://assist-openreplay.{{.Release.Namespace}}.{{.Values.global.clusterDomain}}:9001/assist/%s" + value: {{- include "openreplay.assist_url" . }} - name: ASSIST_JWT_SECRET value: {{ .Values.global.assistJWTSecret }} - name: JWT_SECRET diff --git a/scripts/helmcharts/openreplay/templates/_helpers.tpl b/scripts/helmcharts/openreplay/templates/_helpers.tpl index ddbcb764d..9a99eadf3 100644 --- a/scripts/helmcharts/openreplay/templates/_helpers.tpl +++ b/scripts/helmcharts/openreplay/templates/_helpers.tpl @@ -164,8 +164,8 @@ Create the volume mount config for redis TLS certificates {{- define "openreplay.assist_url"}} {{- if .Values.global.enterpriseEditionLicense }} -assist-api-openreplay:8080 +"http://assist-api-openreplay.{{.Release.Namespace}}.{{.Values.global.clusterDomain}}:9001/assist/%s" {{- else}} -assist-openreplay:8080 +"http://assist-openreplay.{{.Release.Namespace}}.{{.Values.global.clusterDomain}}:9001/assist/%s" {{- end}} {{- end}}