helm: add urlPrefix support for admin UI behind reverse proxy subpath
This commit is contained in:
@@ -84,6 +84,10 @@ spec:
|
|||||||
image: {{ template "admin.image" . }}
|
image: {{ template "admin.image" . }}
|
||||||
imagePullPolicy: {{ default "IfNotPresent" .Values.global.imagePullPolicy }}
|
imagePullPolicy: {{ default "IfNotPresent" .Values.global.imagePullPolicy }}
|
||||||
{{- $adminAuthEnabled := or .Values.admin.secret.existingSecret .Values.admin.secret.adminPassword }}
|
{{- $adminAuthEnabled := or .Values.admin.secret.existingSecret .Values.admin.secret.adminPassword }}
|
||||||
|
{{- $urlPrefix := .Values.admin.urlPrefix }}
|
||||||
|
{{- if and (not $urlPrefix) .Values.admin.ingress.enabled (ne .Values.admin.ingress.path "/") }}
|
||||||
|
{{- $urlPrefix = trimSuffix "/" .Values.admin.ingress.path }}
|
||||||
|
{{- end }}
|
||||||
{{- if and .Values.admin.secret.existingSecret (not .Values.admin.secret.userKey) -}}
|
{{- if and .Values.admin.secret.existingSecret (not .Values.admin.secret.userKey) -}}
|
||||||
{{- fail "admin.secret.userKey must be set when admin.secret.existingSecret is provided" -}}
|
{{- fail "admin.secret.userKey must be set when admin.secret.existingSecret is provided" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -154,11 +158,14 @@ spec:
|
|||||||
-dataDir={{ .Values.admin.dataDir }} \
|
-dataDir={{ .Values.admin.dataDir }} \
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.admin.masters }}
|
{{- if .Values.admin.masters }}
|
||||||
-masters={{ .Values.admin.masters }}{{- if .Values.admin.extraArgs }} \{{ end }}
|
-masters={{ .Values.admin.masters }}{{- if or $urlPrefix .Values.admin.extraArgs }} \{{ end }}
|
||||||
{{- else if .Values.global.masterServer }}
|
{{- else if .Values.global.masterServer }}
|
||||||
-masters={{ .Values.global.masterServer }}{{- if .Values.admin.extraArgs }} \{{ end }}
|
-masters={{ .Values.global.masterServer }}{{- if or $urlPrefix .Values.admin.extraArgs }} \{{ end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
-masters={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master.{{ $.Release.Namespace }}:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}{{- if .Values.admin.extraArgs }} \{{ end }}
|
-masters={{ range $index := until (.Values.master.replicas | int) }}${SEAWEEDFS_FULLNAME}-master-{{ $index }}.${SEAWEEDFS_FULLNAME}-master.{{ $.Release.Namespace }}:{{ $.Values.master.port }}{{ if lt $index (sub ($.Values.master.replicas | int) 1) }},{{ end }}{{ end }}{{- if or $urlPrefix .Values.admin.extraArgs }} \{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if $urlPrefix }}
|
||||||
|
-urlPrefix={{ $urlPrefix }}{{- if .Values.admin.extraArgs }} \{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- range $index, $arg := .Values.admin.extraArgs }}
|
{{- range $index, $arg := .Values.admin.extraArgs }}
|
||||||
{{ $arg }}{{- if lt $index (sub (len $.Values.admin.extraArgs) 1) }} \{{ end }}
|
{{ $arg }}{{- if lt $index (sub (len $.Values.admin.extraArgs) 1) }} \{{ end }}
|
||||||
@@ -205,7 +212,7 @@ spec:
|
|||||||
{{- if .Values.admin.readinessProbe.enabled }}
|
{{- if .Values.admin.readinessProbe.enabled }}
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: {{ .Values.admin.readinessProbe.httpGet.path }}
|
path: {{ if $urlPrefix }}{{ $urlPrefix }}{{ end }}{{ .Values.admin.readinessProbe.httpGet.path }}
|
||||||
port: http
|
port: http
|
||||||
scheme: {{ .Values.admin.readinessProbe.httpGet.scheme }}
|
scheme: {{ .Values.admin.readinessProbe.httpGet.scheme }}
|
||||||
initialDelaySeconds: {{ .Values.admin.readinessProbe.initialDelaySeconds }}
|
initialDelaySeconds: {{ .Values.admin.readinessProbe.initialDelaySeconds }}
|
||||||
@@ -217,7 +224,7 @@ spec:
|
|||||||
{{- if .Values.admin.livenessProbe.enabled }}
|
{{- if .Values.admin.livenessProbe.enabled }}
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: {{ .Values.admin.livenessProbe.httpGet.path }}
|
path: {{ if $urlPrefix }}{{ $urlPrefix }}{{ end }}{{ .Values.admin.livenessProbe.httpGet.path }}
|
||||||
port: http
|
port: http
|
||||||
scheme: {{ .Values.admin.livenessProbe.httpGet.scheme }}
|
scheme: {{ .Values.admin.livenessProbe.httpGet.scheme }}
|
||||||
initialDelaySeconds: {{ .Values.admin.livenessProbe.initialDelaySeconds }}
|
initialDelaySeconds: {{ .Values.admin.livenessProbe.initialDelaySeconds }}
|
||||||
|
|||||||
@@ -1195,6 +1195,11 @@ admin:
|
|||||||
# If empty, uses global.masterServer or auto-discovers from master statefulset
|
# If empty, uses global.masterServer or auto-discovers from master statefulset
|
||||||
masters: ""
|
masters: ""
|
||||||
|
|
||||||
|
# URL path prefix when running behind a reverse proxy under a subdirectory
|
||||||
|
# Example: "/seaweedfs-admin" makes the UI available at /seaweedfs-admin/
|
||||||
|
# If empty and ingress is enabled with a non-root path, the ingress path is used automatically
|
||||||
|
urlPrefix: ""
|
||||||
|
|
||||||
# Custom command line arguments to add to the admin command
|
# Custom command line arguments to add to the admin command
|
||||||
# Example: ["-customFlag", "value", "-anotherFlag"]
|
# Example: ["-customFlag", "value", "-anotherFlag"]
|
||||||
extraArgs: []
|
extraArgs: []
|
||||||
|
|||||||
Reference in New Issue
Block a user