@@ -15,9 +15,9 @@ metadata:
1515 {{- toYaml .Values.allInOne.annotations | nindent 4 }}
1616 {{- end }}
1717spec :
18- replicas : 1
18+ replicas : {{ .Values.allInOne.replicas | default 1 }}
1919 strategy :
20- type : Recreate
20+ type : {{ .Values.allInOne.updateStrategy.type | default " Recreate" }}
2121 selector :
2222 matchLabels :
2323 app.kubernetes.io/name : {{ template "seaweedfs.name" . }}
@@ -130,12 +130,23 @@ spec:
130130 value : {{ include "seaweedfs.cluster.masterAddress" . | quote }}
131131 - name : {{ $clusterFilerKey }}
132132 value : {{ include "seaweedfs.cluster.filerAddress" . | quote }}
133+ {{- if .Values.allInOne.secretExtraEnvironmentVars }}
134+ {{- range $key, $value := .Values.allInOne.secretExtraEnvironmentVars }}
135+ - name : {{ $key }}
136+ valueFrom :
137+ {{ toYaml $value | nindent 16 }}
138+ {{- end }}
139+ {{- end }}
133140 command :
134141 - " /bin/sh"
135142 - " -ec"
136143 - |
137144 /usr/bin/weed \
145+ {{- if .Values.allInOne.loggingOverrideLevel }}
146+ -v={{ .Values.allInOne.loggingOverrideLevel }} \
147+ {{- else }}
138148 -v={{ .Values.global.loggingLevel }} \
149+ {{- end }}
139150 server \
140151 -dir=/data \
141152 -master \
@@ -191,6 +202,9 @@ spec:
191202 {{- else if .Values.master.metricsPort }}
192203 -metricsPort={{ .Values.master.metricsPort }} \
193204 {{- end }}
205+ {{- if .Values.allInOne.metricsIp }}
206+ -metricsIp={{ .Values.allInOne.metricsIp }} \
207+ {{- end }}
194208 -filer \
195209 -filer.port={{ .Values.filer.port }} \
196210 {{- if .Values.filer.disableDirListing }}
@@ -219,61 +233,75 @@ spec:
219233 {{- end }}
220234 {{- if .Values.allInOne.s3.enabled }}
221235 -s3 \
222- -s3.port={{ .Values.s3.port }} \
223- {{- if .Values.s3.domainName }}
224- -s3.domainName={{ .Values.s3.domainName }} \
236+ -s3.port={{ .Values.allInOne.s3.port | default .Values.s3.port }} \
237+ {{- $domainName := .Values.allInOne.s3.domainName | default .Values.s3.domainName }}
238+ {{- if $domainName }}
239+ -s3.domainName={{ $domainName }} \
225240 {{- end }}
226241 {{- if .Values.global.enableSecurity }}
227- {{- if .Values.s3.httpsPort }}
228- -s3.port.https={{ .Values.s3.httpsPort }} \
242+ {{- $httpsPort := .Values.allInOne.s3.httpsPort | default .Values.s3.httpsPort }}
243+ {{- if $httpsPort }}
244+ -s3.port.https={{ $httpsPort }} \
229245 {{- end }}
230246 -s3.cert.file=/usr/local/share/ca-certificates/client/tls.crt \
231247 -s3.key.file=/usr/local/share/ca-certificates/client/tls.key \
232248 {{- end }}
233- {{- if eq (typeOf .Values.s3.allowEmptyFolder) "bool" }}
234- -s3.allowEmptyFolder={{ .Values.s3.allowEmptyFolder }} \
235- {{- end }}
236- {{- if .Values.s3.enableAuth }}
249+ {{- if or .Values.allInOne.s3.enableAuth .Values.s3.enableAuth .Values.filer.s3.enableAuth }}
237250 -s3.config=/etc/sw/s3/seaweedfs_s3_config \
238251 {{- end }}
239- {{- if .Values.s3.auditLogConfig }}
252+ {{- $auditLogConfig := .Values.allInOne.s3.auditLogConfig | default .Values.s3.auditLogConfig }}
253+ {{- if $auditLogConfig }}
240254 -s3.auditLogConfig=/etc/sw/s3/s3_auditLogConfig.json \
241255 {{- end }}
242256 {{- end }}
243257 {{- if .Values.allInOne.sftp.enabled }}
244258 -sftp \
245- -sftp.port={{ .Values.sftp.port }} \
246- {{- if .Values.sftp.sshPrivateKey }}
247- -sftp.sshPrivateKey={{ .Values.sftp.sshPrivateKey }} \
259+ -sftp.port={{ .Values.allInOne.sftp.port | default .Values.sftp.port }} \
260+ {{- $sshPrivateKey := .Values.allInOne.sftp.sshPrivateKey | default .Values.sftp.sshPrivateKey }}
261+ {{- if $sshPrivateKey }}
262+ -sftp.sshPrivateKey={{ $sshPrivateKey }} \
248263 {{- end }}
249- {{- if .Values.sftp.hostKeysFolder }}
250- -sftp.hostKeysFolder={{ .Values.sftp.hostKeysFolder }} \
264+ {{- $hostKeysFolder := .Values.allInOne.sftp.hostKeysFolder | default .Values.sftp.hostKeysFolder }}
265+ {{- if $hostKeysFolder }}
266+ -sftp.hostKeysFolder={{ $hostKeysFolder }} \
251267 {{- end }}
252- {{- if .Values.sftp.authMethods }}
253- -sftp.authMethods={{ .Values.sftp.authMethods }} \
268+ {{- $authMethods := .Values.allInOne.sftp.authMethods | default .Values.sftp.authMethods }}
269+ {{- if $authMethods }}
270+ -sftp.authMethods={{ $authMethods }} \
254271 {{- end }}
255- {{- if .Values.sftp.maxAuthTries }}
256- -sftp.maxAuthTries={{ .Values.sftp.maxAuthTries }} \
272+ {{- $maxAuthTries := .Values.allInOne.sftp.maxAuthTries | default .Values.sftp.maxAuthTries }}
273+ {{- if $maxAuthTries }}
274+ -sftp.maxAuthTries={{ $maxAuthTries }} \
257275 {{- end }}
258- {{- if .Values.sftp.bannerMessage }}
259- -sftp.bannerMessage="{{ .Values.sftp.bannerMessage }}" \
276+ {{- $bannerMessage := .Values.allInOne.sftp.bannerMessage | default .Values.sftp.bannerMessage }}
277+ {{- if $bannerMessage }}
278+ -sftp.bannerMessage="{{ $bannerMessage }}" \
260279 {{- end }}
261- {{- if .Values.sftp.loginGraceTime }}
262- -sftp.loginGraceTime={{ .Values.sftp.loginGraceTime }} \
280+ {{- $loginGraceTime := .Values.allInOne.sftp.loginGraceTime | default .Values.sftp.loginGraceTime }}
281+ {{- if $loginGraceTime }}
282+ -sftp.loginGraceTime={{ $loginGraceTime }} \
263283 {{- end }}
264- {{- if .Values.sftp.clientAliveInterval }}
265- -sftp.clientAliveInterval={{ .Values.sftp.clientAliveInterval }} \
284+ {{- $clientAliveInterval := .Values.allInOne.sftp.clientAliveInterval | default .Values.sftp.clientAliveInterval }}
285+ {{- if $clientAliveInterval }}
286+ -sftp.clientAliveInterval={{ $clientAliveInterval }} \
266287 {{- end }}
267- {{- if .Values.sftp.clientAliveCountMax }}
268- -sftp.clientAliveCountMax={{ .Values.sftp.clientAliveCountMax }} \
288+ {{- $clientAliveCountMax := .Values.allInOne.sftp.clientAliveCountMax | default .Values.sftp.clientAliveCountMax }}
289+ {{- if $clientAliveCountMax }}
290+ -sftp.clientAliveCountMax={{ $clientAliveCountMax }} \
269291 {{- end }}
292+ {{- if or .Values.allInOne.sftp.enableAuth .Values.sftp.enableAuth }}
270293 -sftp.userStoreFile=/etc/sw/sftp/seaweedfs_sftp_config \
271294 {{- end }}
295+ {{- end }}
296+ {{- $extraArgsCount := len .Values.allInOne.extraArgs }}
297+ {{- range $i, $arg := .Values.allInOne.extraArgs }}
298+ {{ $arg | quote }}{{ if ne (add1 $i) $extraArgsCount }} \{{ end }}
299+ {{- end }}
272300
273301 volumeMounts :
274302 - name : data
275303 mountPath : /data
276- {{- if and .Values.allInOne.s3.enabled (or .Values.s3.enableAuth .Values.filer.s3.enableAuth) }}
304+ {{- if and .Values.allInOne.s3.enabled (or .Values.allInOne.s3.enableAuth .Values. s3.enableAuth .Values.filer.s3.enableAuth) }}
277305 - name : config-s3-users
278306 mountPath : /etc/sw/s3
279307 readOnly : true
@@ -282,10 +310,12 @@ spec:
282310 - name : config-ssh
283311 mountPath : /etc/sw/ssh
284312 readOnly : true
313+ {{- if or .Values.allInOne.sftp.enableAuth .Values.sftp.enableAuth }}
285314 - mountPath : /etc/sw/sftp
286315 name : config-users
287316 readOnly : true
288317 {{- end }}
318+ {{- end }}
289319 {{- if .Values.filer.notificationConfig }}
290320 - name : notification-config
291321 mountPath : /etc/seaweedfs/notification.toml
@@ -332,15 +362,16 @@ spec:
332362 - containerPort : {{ .Values.filer.grpcPort }}
333363 name : swfs-fil-grpc
334364 {{- if .Values.allInOne.s3.enabled }}
335- - containerPort : {{ .Values.s3.port }}
365+ - containerPort : {{ .Values.allInOne.s3.port | default .Values. s3.port }}
336366 name : swfs-s3
337- {{- if .Values.s3.httpsPort }}
338- - containerPort : {{ .Values.s3.httpsPort }}
367+ {{- $httpsPort := .Values.allInOne.s3.httpsPort | default .Values.s3.httpsPort }}
368+ {{- if $httpsPort }}
369+ - containerPort : {{ $httpsPort }}
339370 name : swfs-s3-tls
340371 {{- end }}
341372 {{- end }}
342373 {{- if .Values.allInOne.sftp.enabled }}
343- - containerPort : {{ .Values.sftp.port }}
374+ - containerPort : {{ .Values.allInOne.sftp.port | default .Values. sftp.port }}
344375 name : swfs-sftp
345376 {{- end }}
346377 {{- if .Values.allInOne.metricsPort }}
@@ -352,7 +383,7 @@ spec:
352383 httpGet :
353384 path : {{ .Values.allInOne.readinessProbe.httpGet.path }}
354385 port : {{ .Values.master.port }}
355- scheme : {{ .Values.allInOne.readinessProbe.scheme }}
386+ scheme : {{ .Values.allInOne.readinessProbe.httpGet. scheme }}
356387 initialDelaySeconds : {{ .Values.allInOne.readinessProbe.initialDelaySeconds }}
357388 periodSeconds : {{ .Values.allInOne.readinessProbe.periodSeconds }}
358389 successThreshold : {{ .Values.allInOne.readinessProbe.successThreshold }}
@@ -364,7 +395,7 @@ spec:
364395 httpGet :
365396 path : {{ .Values.allInOne.livenessProbe.httpGet.path }}
366397 port : {{ .Values.master.port }}
367- scheme : {{ .Values.allInOne.livenessProbe.scheme }}
398+ scheme : {{ .Values.allInOne.livenessProbe.httpGet. scheme }}
368399 initialDelaySeconds : {{ .Values.allInOne.livenessProbe.initialDelaySeconds }}
369400 periodSeconds : {{ .Values.allInOne.livenessProbe.periodSeconds }}
370401 successThreshold : {{ .Values.allInOne.livenessProbe.successThreshold }}
@@ -389,26 +420,31 @@ spec:
389420 path : {{ .Values.allInOne.data.hostPathPrefix }}/seaweedfs-all-in-one-data/
390421 type : DirectoryOrCreate
391422 {{- else if eq .Values.allInOne.data.type "persistentVolumeClaim" }}
423+ persistentVolumeClaim :
424+ claimName : {{ template "seaweedfs.name" . }}-all-in-one-data
425+ {{- else if eq .Values.allInOne.data.type "existingClaim" }}
392426 persistentVolumeClaim :
393427 claimName : {{ .Values.allInOne.data.claimName }}
394428 {{- else if eq .Values.allInOne.data.type "emptyDir" }}
395429 emptyDir : {}
396430 {{- end }}
397- {{- if and .Values.allInOne.s3.enabled (or .Values.s3.enableAuth .Values.filer.s3.enableAuth) }}
431+ {{- if and .Values.allInOne.s3.enabled (or .Values.allInOne.s3.enableAuth .Values. s3.enableAuth .Values.filer.s3.enableAuth) }}
398432 - name : config-s3-users
399433 secret :
400434 defaultMode : 420
401- secretName : {{ default (printf "%s-s3-secret" (include "seaweedfs.name" .)) (or .Values.s3.existingConfigSecret .Values.filer.s3.existingConfigSecret) }}
435+ secretName : {{ default (printf "%s-s3-secret" (include "seaweedfs.name" .)) (or .Values.allInOne.s3.existingConfigSecret .Values. s3.existingConfigSecret .Values.filer.s3.existingConfigSecret) }}
402436 {{- end }}
403437 {{- if .Values.allInOne.sftp.enabled }}
404438 - name : config-ssh
405439 secret :
406440 defaultMode : 420
407- secretName : {{ default (printf "%s-sftp-ssh-secret" (include "seaweedfs.name" .)) .Values.sftp.existingSshConfigSecret }}
441+ secretName : {{ default (printf "%s-sftp-ssh-secret" (include "seaweedfs.name" .)) (or .Values.allInOne.sftp.existingSshConfigSecret .Values.sftp.existingSshConfigSecret) }}
442+ {{- if or .Values.allInOne.sftp.enableAuth .Values.sftp.enableAuth }}
408443 - name : config-users
409444 secret :
410445 defaultMode : 420
411- secretName : {{ default (printf "%s-sftp-secret" (include "seaweedfs.name" .)) .Values.sftp.existingConfigSecret }}
446+ secretName : {{ default (printf "%s-sftp-secret" (include "seaweedfs.name" .)) (or .Values.allInOne.sftp.existingConfigSecret .Values.sftp.existingConfigSecret) }}
447+ {{- end }}
412448 {{- end }}
413449 {{- if .Values.filer.notificationConfig }}
414450 - name : notification-config
0 commit comments