Skip to content

Commit 1805be3

Browse files
committed
Update SeaweedFS v4.02
Signed-off-by: Andrei Kvapil <[email protected]>
1 parent 1f0b5ff commit 1805be3

16 files changed

Lines changed: 333 additions & 185 deletions

File tree

‎packages/system/seaweedfs/Makefile‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ update:
1212
sed -i.bak "/ARG VERSION/ s|=.*|=$${version}|g" images/seaweedfs/Dockerfile && \
1313
rm -f images/seaweedfs/Dockerfile.bak
1414
patch --no-backup-if-mismatch -p4 < patches/resize-api-server-annotation.diff
15-
patch --no-backup-if-mismatch -p4 < patches/long-term-ca.diff
1615
#patch --no-backup-if-mismatch -p4 < patches/retention-policy-delete.yaml
1716

1817
image:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
22
description: SeaweedFS
33
name: seaweedfs
4-
appVersion: "3.99"
4+
appVersion: "4.02"
55
# Dev note: Trigger a helm chart release by `git tag -a helm-<version>`
6-
version: 4.0.399
6+
version: 4.0.402

‎packages/system/seaweedfs/charts/seaweedfs/templates/all-in-one/all-in-one-deployment.yaml‎

Lines changed: 76 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ metadata:
1515
{{- toYaml .Values.allInOne.annotations | nindent 4 }}
1616
{{- end }}
1717
spec:
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
Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
1-
{{- if and .Values.allInOne.enabled (eq .Values.allInOne.data.type "persistentVolumeClaim") }}
1+
{{- if .Values.allInOne.enabled }}
2+
{{- if eq .Values.allInOne.data.type "persistentVolumeClaim" }}
23
apiVersion: v1
34
kind: PersistentVolumeClaim
45
metadata:
5-
name: {{ .Values.allInOne.data.claimName }}
6+
name: {{ template "seaweedfs.name" . }}-all-in-one-data
7+
namespace: {{ .Release.Namespace }}
68
labels:
9+
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
10+
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
11+
app.kubernetes.io/managed-by: {{ .Release.Service }}
12+
app.kubernetes.io/instance: {{ .Release.Name }}
713
app.kubernetes.io/component: seaweedfs-all-in-one
8-
{{- if .Values.allInOne.annotations }}
14+
{{- with .Values.allInOne.data.annotations }}
915
annotations:
10-
{{- toYaml .Values.allInOne.annotations | nindent 4 }}
16+
{{- toYaml . | nindent 4 }}
1117
{{- end }}
1218
spec:
1319
accessModes:
14-
- ReadWriteOnce
15-
resources:
16-
requests:
17-
storage: {{ .Values.allInOne.data.size }}
20+
{{- toYaml (.Values.allInOne.data.accessModes | default (list "ReadWriteOnce")) | nindent 4 }}
1821
{{- if .Values.allInOne.data.storageClass }}
1922
storageClassName: {{ .Values.allInOne.data.storageClass }}
2023
{{- end }}
21-
{{- end }}
24+
resources:
25+
requests:
26+
storage: {{ .Values.allInOne.data.size | default "10Gi" }}
27+
{{- end }}
28+
{{- end }}

‎packages/system/seaweedfs/charts/seaweedfs/templates/all-in-one/all-in-one-service.yml‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ metadata:
1515
{{- toYaml .Values.allInOne.service.annotations | nindent 4 }}
1616
{{- end }}
1717
spec:
18+
type: {{ .Values.allInOne.service.type | default "ClusterIP" }}
1819
internalTrafficPolicy: {{ .Values.allInOne.service.internalTrafficPolicy | default "Cluster" }}
1920
ports:
2021
# Master ports
@@ -50,22 +51,23 @@ spec:
5051
# S3 ports (if enabled)
5152
{{- if .Values.allInOne.s3.enabled }}
5253
- name: "swfs-s3"
53-
port: {{ if .Values.allInOne.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
54-
targetPort: {{ if .Values.allInOne.s3.enabled }}{{ .Values.s3.port }}{{ else }}{{ .Values.filer.s3.port }}{{ end }}
54+
port: {{ .Values.allInOne.s3.port | default .Values.s3.port }}
55+
targetPort: {{ .Values.allInOne.s3.port | default .Values.s3.port }}
5556
protocol: TCP
56-
{{- if and .Values.allInOne.s3.enabled .Values.s3.httpsPort }}
57+
{{- $httpsPort := .Values.allInOne.s3.httpsPort | default .Values.s3.httpsPort }}
58+
{{- if $httpsPort }}
5759
- name: "swfs-s3-tls"
58-
port: {{ .Values.s3.httpsPort }}
59-
targetPort: {{ .Values.s3.httpsPort }}
60+
port: {{ $httpsPort }}
61+
targetPort: {{ $httpsPort }}
6062
protocol: TCP
6163
{{- end }}
6264
{{- end }}
6365

6466
# SFTP ports (if enabled)
6567
{{- if .Values.allInOne.sftp.enabled }}
6668
- name: "swfs-sftp"
67-
port: {{ .Values.sftp.port }}
68-
targetPort: {{ .Values.sftp.port }}
69+
port: {{ .Values.allInOne.sftp.port | default .Values.sftp.port }}
70+
targetPort: {{ .Values.allInOne.sftp.port | default .Values.sftp.port }}
6971
protocol: TCP
7072
{{- end }}
7173

@@ -80,4 +82,4 @@ spec:
8082
selector:
8183
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
8284
app.kubernetes.io/component: seaweedfs-all-in-one
83-
{{- end }}
85+
{{- end }}

‎packages/system/seaweedfs/charts/seaweedfs/templates/cert/ca-cert.yaml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ spec:
1313
secretName: {{ template "seaweedfs.name" . }}-ca-cert
1414
commonName: "{{ template "seaweedfs.name" . }}-root-ca"
1515
isCA: true
16-
duration: 87600h
17-
renewBefore: 720h
16+
{{- if .Values.certificates.ca.duration }}
17+
duration: {{ .Values.certificates.ca.duration }}
18+
{{- end }}
19+
{{- if .Values.certificates.ca.renewBefore }}
20+
renewBefore: {{ .Values.certificates.ca.renewBefore }}
21+
{{- end }}
1822
issuerRef:
1923
name: {{ template "seaweedfs.name" . }}-issuer
2024
kind: Issuer

‎packages/system/seaweedfs/charts/seaweedfs/templates/filer/filer-ingress.yaml‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
{{- if .Values.filer.enabled }}
2-
{{- if .Values.filer.ingress.enabled }}
1+
{{- /* Filer ingress works for both normal mode (filer.enabled) and all-in-one mode (allInOne.enabled) */}}
2+
{{- $filerEnabled := or .Values.filer.enabled .Values.allInOne.enabled }}
3+
{{- if and $filerEnabled .Values.filer.ingress.enabled }}
4+
{{- /* Determine service name based on deployment mode */}}
5+
{{- $serviceName := ternary (printf "%s-all-in-one" (include "seaweedfs.name" .)) (printf "%s-filer" (include "seaweedfs.name" .)) .Values.allInOne.enabled }}
36
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
47
apiVersion: networking.k8s.io/v1
58
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion }}
@@ -33,16 +36,14 @@ spec:
3336
backend:
3437
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
3538
service:
36-
name: {{ template "seaweedfs.name" . }}-filer
39+
name: {{ $serviceName }}
3740
port:
3841
number: {{ .Values.filer.port }}
39-
#name:
4042
{{- else }}
41-
serviceName: {{ template "seaweedfs.name" . }}-filer
43+
serviceName: {{ $serviceName }}
4244
servicePort: {{ .Values.filer.port }}
4345
{{- end }}
4446
{{- if .Values.filer.ingress.host }}
4547
host: {{ .Values.filer.ingress.host }}
4648
{{- end }}
4749
{{- end }}
48-
{{- end }}

0 commit comments

Comments
 (0)