File tree Expand file tree Collapse file tree
support-files/kubernetes/helm/bk-nodeman/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,3 +290,28 @@ initContainers:
290290 resources:
291291 {{- toYaml .Values.migrateJob.fileSync.resources | nindent 6 }}
292292{{- end }}
293+
294+ {{- define " bk-nodeman.ingress-host" -}}
295+ {{- $ingress := index . 0 -}}
296+ {{- $global := index . 1 -}}
297+ {{- if eq $global .bkWebSiteAccess.mode " subpath" -}}
298+ {{- $global .bkDomain -}}
299+ {{- else -}}
300+ {{- printf " %s .%s " $ingress .name $global .bkDomain -}}
301+ {{- end -}}
302+ {{- end -}}
303+
304+ {{- define " bk-nodeman.ingress-url" -}}
305+ {{- $ingress := index . 0 -}}
306+ {{- $global := index . 1 -}}
307+ {{- $host := include " bk-nodeman.ingress-host" (list $ingress $global ) -}}
308+ {{- if $ingress .port -}}
309+ {{- $host = printf " %s :%v " $host $ingress .port -}}
310+ {{- end -}}
311+ {{- $scheme := $global .bkDomainScheme -}}
312+ {{- if eq $global .bkWebSiteAccess.mode " subpath" -}}
313+ {{- printf " %s ://%s " $scheme (include " bk-nodeman.urljoin" (list $host $ingress .name $ingress .path ) | trimSuffix " /" ) -}}
314+ {{- else -}}
315+ {{- printf " %s ://%s " $scheme (include " bk-nodeman.urljoin" (list $host $ingress .path ) | trimSuffix " /" ) -}}
316+ {{- end -}}
317+ {{- end -}}
Original file line number Diff line number Diff line change 5959 BKAPP_BK_GSE_APIGATEWAY : " {{ .Values.config.bkAppBkGseApiGateway }}/"
6060 {{- end }}
6161
62+ {{- if eq .Values.global.bkWebSiteAccess.mode "subpath"}}
63+ BK_NODEMAN_SUBPATH : " /bknodeman/"
64+ {{- else}}
65+ BK_NODEMAN_SUBPATH : " "
66+ {{- end}}
67+
6268 BK_NODEMAN_URL : " {{ .Values.bkNodemanUrl }}"
6369 BKAPP_BACKEND_HOST : " {{ .Values.config.bkAppBackendHost | default .Values.bkNodemanApiUrl }}"
6470 BKAPP_NODEMAN_CALLBACK_URL : " {{ .Values.config.bkAppNodemanCallbackUrl | default ( printf " %s/%s" .Values.bkNodemanUrl "backend" ) }}"
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ metadata:
3333 {{- range $key, $value := .Values.ingress.annotations }}
3434 {{ $key }}: {{ include "common.tplvalues.render" (dict "value" $value "context" $) | quote }}
3535 {{- end }}
36+ {{- if eq .Values.global.bkWebSiteAccess.mode "subpath" }}
37+ nginx.ingress.kubernetes.io/use-regex : " true"
38+ nginx.ingress.kubernetes.io/rewrite-target : /$1$2
39+ {{ end }}
3640spec :
3741 {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
3842 ingressClassName : {{ .Values.ingress.className }}
5660 {{- toYaml .Values.ingress.extraPaths | nindent 10 }}
5761 {{- end }}
5862 {{- range .Values.ingress.paths }}
59- - path : {{ . path }}
63+ - path : {{ if eq .Values.global.bkWebSiteAccess.mode "subpath" }}/{{ .Values.ingress.name }}/(.*/)(.*){{ else }}{{ . path }}{{ end }}
6064 {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
6165 pathType : {{ .pathType }}
6266 {{- end }}
You can’t perform that action at this time.
0 commit comments