From 8f5ca712fa41c90faa2a5091699db1af12621d26 Mon Sep 17 00:00:00 2001 From: Vishal Tak Date: Wed, 17 Sep 2025 17:21:21 +0530 Subject: [PATCH] Fix workspaces ingress hostname --- .../gitlab/charts/kas/templates/ingress-workspaces.yaml | 6 +++--- charts/gitlab/templates/_kas.tpl | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/charts/gitlab/charts/kas/templates/ingress-workspaces.yaml b/charts/gitlab/charts/kas/templates/ingress-workspaces.yaml index b1236c299a..5a864eebaf 100644 --- a/charts/gitlab/charts/kas/templates/ingress-workspaces.yaml +++ b/charts/gitlab/charts/kas/templates/ingress-workspaces.yaml @@ -1,6 +1,6 @@ {{- if and .Values.global.kas.enabled .Values.global.workspaces.enabled -}} {{- if eq (include "gitlab.ingress.enabled" $) "true" -}} -{{- $hostname := include "gitlab.workspaces.hostname" . -}} +{{- $wildcardHostname := include "gitlab.workspaces.wildcardHostname" . -}} {{- $tlsSecret := include "workspaces.tlsSecret" . -}} {{- $ingressCfg := dict "global" .Values.global.ingress "local" .Values.ingress "context" . -}} apiVersion: networking.k8s.io/v1 @@ -25,7 +25,7 @@ metadata: spec: {{ include "ingress.class.field" $ingressCfg }} rules: - - host: {{ include "gitlab.workspaces.hostname" . | quote }} + - host: {{ $wildcardHostname | quote }} http: paths: - path: "/" @@ -38,7 +38,7 @@ spec: {{- if (and $tlsSecret (eq (include "gitlab.ingress.tls.enabled" $) "true" )) }} tls: - hosts: - - {{ $hostname }} + - {{ $wildcardHostname | quote }} secretName: {{ $tlsSecret }} {{- end }} {{- end -}} diff --git a/charts/gitlab/templates/_kas.tpl b/charts/gitlab/templates/_kas.tpl index 99353cf205..af0b31e7ed 100644 --- a/charts/gitlab/templates/_kas.tpl +++ b/charts/gitlab/templates/_kas.tpl @@ -44,6 +44,14 @@ Returns the workspaces external hostname {{- $hostname -}} {{- end -}} +{{/* +Returns the workspaces wildcard hostname +*/}} +{{- define "gitlab.workspaces.wildcardHostname" -}} +{{- $hostname := include "gitlab.workspaces.hostname" . -}} +{{- print "*." $hostname -}} +{{- end -}} + {{- define "gitlab.kas.internal.scheme" -}} {{- printf "%s" (ternary "grpcs" "grpc" (eq $.Values.global.kas.tls.enabled true)) -}} {{- end -}} -- GitLab