@ -79,6 +79,12 @@ spec:
image : {{ template "master.image" . }}
image : {{ template "master.image" . }}
imagePullPolicy : {{ default "IfNotPresent" .Values.global.imagePullPolicy }}
imagePullPolicy : {{ default "IfNotPresent" .Values.global.imagePullPolicy }}
env:
env:
{{- /* Determine default cluster alias and the corresponding env var keys to avoid conflicts */}}
{{- $envMerged := merge (.Values.global.extraEnvironmentVars | default dict) (.Values.allInOne.extraEnvironmentVars | default dict) }}
{{- $clusterDefault := default "sw" (index $envMerged "WEED_CLUSTER_DEFAULT") }}
{{- $clusterUpper := upper $clusterDefault }}
{{- $clusterMasterKey := printf "WEED_CLUSTER_%s_MASTER" $clusterUpper }}
{{- $clusterFilerKey := printf "WEED_CLUSTER_%s_FILER" $clusterUpper }}
- name : POD_IP
- name : POD_IP
valueFrom:
valueFrom:
fieldRef:
fieldRef:
@ -95,6 +101,7 @@ spec:
value : "{{ template " seaweedfs.name" . }}"
value : "{{ template " seaweedfs.name" . }}"
{{- if .Values.allInOne.extraEnvironmentVars }}
{{- if .Values.allInOne.extraEnvironmentVars }}
{{- range $key, $value := .Values.allInOne.extraEnvironmentVars }}
{{- range $key, $value := .Values.allInOne.extraEnvironmentVars }}
{{- if and (ne $key $clusterMasterKey) (ne $key $clusterFilerKey) }}
- name : {{ $key }}
- name : {{ $key }}
{{- if kindIs "string" $value }}
{{- if kindIs "string" $value }}
value : {{ $value | quote }}
value : {{ $value | quote }}
@ -104,8 +111,10 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.global.extraEnvironmentVars }}
{{- if .Values.global.extraEnvironmentVars }}
{{- range $key, $value := .Values.global.extraEnvironmentVars }}
{{- range $key, $value := .Values.global.extraEnvironmentVars }}
{{- if and (ne $key $clusterMasterKey) (ne $key $clusterFilerKey) }}
- name : {{ $key }}
- name : {{ $key }}
{{- if kindIs "string" $value }}
{{- if kindIs "string" $value }}
value : {{ $value | quote }}
value : {{ $value | quote }}
@ -115,6 +124,12 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
# Inject computed cluster endpoints for the default cluster
- name : {{ $clusterMasterKey }}
value : {{ include "seaweedfs.cluster.masterAddress" . | quote }}
- name : {{ $clusterFilerKey }}
value : {{ include "seaweedfs.cluster.filerAddress" . | quote }}
command:
command:
- "/bin/sh"
- "/bin/sh"
- "-ec"
- "-ec"