Skip to content

Commit b4146f6

Browse files
author
mason
committed
[Helm] Fix the problem that domain name cannot be forwarded when using NodePort
1 parent 4b7a085 commit b4146f6

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

helm/charts/csghub/charts/server/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ data:
102102
STARHUB_SERVER_PUBLIC_DOMAIN: {{ include "csghub.external.endpoint" . }}
103103
# Deprecated ==> re-enabled
104104
{{- if .Values.global.deploy.usePublicDomain }}
105-
STARHUB_SERVER_PUBLIC_ROOT_DOMAIN: {{ include "csghub.external.public.domain" . | quote }}
105+
STARHUB_SERVER_PUBLIC_ROOT_DOMAIN: {{ include "csghub.external.public.endpoint" . | trimPrefix "http://" | trimPrefix "https://" | quote }}
106106
{{- else }}
107107
STARHUB_SERVER_PUBLIC_ROOT_DOMAIN: ""
108108
{{- end }}

helm/charts/csghub/templates/_csghub.tpl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,24 @@ Define the external endpoint for csghub
4141
{{- printf "http://%s" $domain -}}
4242
{{- end }}
4343
{{- end }}
44+
{{- end }}
45+
46+
{{/*
47+
Define the external public endpoint for csghub
48+
*/}}
49+
{{- define "csghub.external.public.endpoint" -}}
50+
{{- $domain := include "csghub.external.public.domain" . }}
51+
{{- if eq .Values.global.ingress.service.type "NodePort" }}
52+
{{- if .Values.global.ingress.tls.enabled -}}
53+
{{- printf "https://%s:%s" $domain "30443" -}}
54+
{{- else }}
55+
{{- printf "http://%s:%s" $domain "30080" -}}
56+
{{- end }}
57+
{{- else }}
58+
{{- if .Values.global.ingress.tls.enabled -}}
59+
{{- printf "https://%s" $domain -}}
60+
{{- else }}
61+
{{- printf "http://%s" $domain -}}
62+
{{- end }}
63+
{{- end }}
4464
{{- end }}

0 commit comments

Comments
 (0)