chore(seaweedfs): bump chart and in-tree image to 4.48

Re-vendor the chart from the 4.48 source archive and apply the carried
patches in order; every one applies without fuzz. The s3-grpc-tls patch
is dropped: 4.48 ships the same [grpc.s3] section, and the forward
guard in make update stops at that patch by design.

images/seaweedfs moves to the same tag so the binary matches the chart.
The source checksum comes from the archive and the upstream digest from
the registry. The builder tag is unchanged in 4.48, and the read-ahead
patch still applies there. The crowded-lock patch is dropped: 4.48
already carries seaweedfs/seaweedfs#11216, so git apply rejects it.

The new checksum annotations include the master ConfigMap and the s3
Secret templates, so the suites rendering those workloads now list
them. weed admin refuses an unauthenticated non-loopback bind since
4.46, so the admin fixtures carry the credentials Secret the parent
chart always sets.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Aleksei Sviridkin committed 2026-11-19 19:30:22 +03:00
1 parent d88322197f
commit c87fcffb21
33 files changed
+245 -169

No files matched your search

-5
View File
@@ -61,11 +61,6 @@ update:
patch --no-backup-if-mismatch -p4 < patches/s3-service-name.patch
patch --no-backup-if-mismatch -p4 < patches/s3-service-name-consumers.patch
patch --no-backup-if-mismatch -p4 < patches/cluster-scoped-names-per-namespace.patch
# Backport of seaweedfs/seaweedfs#11157, released in 4.46: drop the patch
# once the vendored chart carries [grpc.s3]. --forward makes that point
# fail here, where BSD patch would otherwise reverse it and remove the
# section without an error.
patch --forward --no-backup-if-mismatch -p4 < patches/s3-grpc-tls.patch
patch --forward --no-backup-if-mismatch -p4 < patches/storage-class-string.patch
#patch --no-backup-if-mismatch -p4 < patches/retention-policy-delete.yaml
$(MAKE) update-image
@@ -1,6 +1,6 @@
apiVersion: v1
description: SeaweedFS
name: seaweedfs
appVersion: "4.45"
appVersion: "4.48"
# Dev note: Trigger a helm chart release by `git tag -a helm-<version>`
version: 4.45.0
version: 4.48.0
@@ -286,7 +286,7 @@ metadata:
app.kubernetes.io/component: s3
stringData:
# this key must be an inline json config file
seaweedfs_s3_config: '{"identities":[{"name":"anvAdmin","credentials":[{"accessKey":"snu8yoP6QAlY0ne4","secretKey":"PNzBcmeLNEdR0oviwm04NQAicOrDH1Km"}],"actions":["Admin","Read","Write"]},{"name":"anvReadOnly","credentials":[{"accessKey":"SCigFee6c5lbi04A","secretKey":"kgFhbT38R8WUYVtiFQ1OiSVOrYr3NKku"}],"actions":["Read"]}]}'
seaweedfs_s3_config: '{"identities":[{"name":"anvAdmin","credentials":[{"accessKey":"snu8yoP6QAlY0ne4","secretKey":"PNzBcmeLNEdR0oviwm04NQAicOrDH1Km"}],"actions":["Admin","Read","Write"]},{"name":"anvReadOnly","credentials":[{"accessKey":"SCigFee6c5lbi04A","secretKey":"kgFhbT38R8WUYVtiFQ1OiSVOrYr3NKku"}],"actions":["Read","List"]}]}'
```
#### Source S3 credentials from an existing Secret
@@ -363,6 +363,30 @@ If `adminPassword` is empty or not set, the admin interface runs without authent
As an alternative, a kubernetes Secret can be used (`admin.secret.existingSecret`).
### Admin listen address
Since SeaweedFS 4.46, `weed admin` defaults to listening on loopback (`127.0.0.1`).
The chart's httpGet readiness/liveness probes dial the pod IP, so the admin
server must bind a non-loopback address for the probes to succeed. The chart
therefore passes `-ip={{ .Values.admin.ip }}`, defaulting `admin.ip` to `0.0.0.0`
(the pre-4.46 behaviour of listening on all interfaces).
Binding a non-loopback address requires authentication: `weed admin` refuses to
start on a non-loopback address without `-adminPassword`, so the chart fails at
render time if `admin.ip` is non-loopback and authentication is not configured via
`admin.secret.adminPassword`, `admin.secret.existingSecret`, or
`WEED_ADMIN_PASSWORD` supplied through `admin.extraEnvironmentVars` /
`admin.secretExtraEnvironmentVars`. Setting `admin.allowInsecureBind` renders
`-allowInsecureBind` and bypasses this guard; it leaves the admin API
unauthenticated on the network, so use it only when access is otherwise
restricted (e.g. network policies). The whole `127.0.0.0/8` range and `::1` are
treated as loopback (matching `weed admin`); `localhost` is treated as
non-loopback. Set `admin.ip` to a loopback address only if you also replace the
httpGet probes (e.g. with an `exec` probe that checks `127.0.0.1`).
The `-ip` flag requires SeaweedFS 4.46 or newer; pinning `admin.imageOverride`
to an older image is not supported with this chart version.
### Admin Data Persistence
The admin component can store configuration and maintenance data. You can configure storage in several ways:
@@ -0,0 +1,7 @@
# Admin install: exercises the admin StatefulSet, which passes -ip (default
# 0.0.0.0) and therefore requires authentication to bind a non-loopback address.
admin:
enabled: true
secret:
adminUser: "admin"
adminPassword: "ci-admin-password"
@@ -23,6 +23,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: admin
{{- with .Values.admin.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.admin.ingress.className }}
ingressClassName: {{ .Values.admin.ingress.className | quote }}
@@ -6,6 +6,11 @@
{{- if and (not .Values.admin.masters) (not .Values.global.seaweedfs.masterServer) (not .Values.master.enabled) }}
{{- fail "admin.masters or global.seaweedfs.masterServer must be set if master.enabled is false" -}}
{{- end }}
{{- $adminAuthEnabled := include "seaweedfs.admin.authEnabled" . }}
{{- $adminIp := .Values.admin.ip | default "0.0.0.0" }}
{{- if and (not (include "seaweedfs.admin.isLoopbackIp" $adminIp)) (ne $adminAuthEnabled "true") }}
{{- fail (printf "admin.ip is set to %q (non-loopback) but admin authentication is not configured. Since `weed admin` 4.46 refuses to bind a non-loopback address without authentication, the admin container would exit on startup. Set admin.secret.adminPassword or admin.secret.existingSecret, or supply WEED_ADMIN_PASSWORD via admin.extraEnvironmentVars / admin.secretExtraEnvironmentVars, or set admin.ip to a loopback address such as 127.0.0.1 (note: a loopback bind makes the chart's httpGet readiness/liveness probes fail), or set admin.allowInsecureBind to true to opt out via -allowInsecureBind (INSECURE: exposes the admin API unauthenticated on the network)." $adminIp) -}}
{{- end }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@@ -162,6 +167,7 @@ spec:
-v={{ .Values.global.seaweedfs.loggingLevel }} \
{{- end }}
admin \
-ip={{ .Values.admin.ip | default "0.0.0.0" }} \
-port={{ .Values.admin.port }} \
-port.grpc={{ .Values.admin.grpcPort }} \
{{- if or (eq .Values.admin.data.type "hostPath") (eq .Values.admin.data.type "persistentVolumeClaim") (eq .Values.admin.data.type "emptyDir") (eq .Values.admin.data.type "existingClaim") }}
@@ -170,14 +176,17 @@ spec:
-dataDir={{ .Values.admin.dataDir }} \
{{- end }}
{{- if .Values.admin.masters }}
-masters={{ .Values.admin.masters }}{{- if or $urlPrefix .Values.admin.extraArgs }} \{{ end }}
-masters={{ .Values.admin.masters }} \
{{- else if .Values.global.seaweedfs.masterServer }}
-masters={{ .Values.global.seaweedfs.masterServer }}{{- if or $urlPrefix .Values.admin.extraArgs }} \{{ end }}
-masters={{ .Values.global.seaweedfs.masterServer }} \
{{- 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 or $urlPrefix .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 }} \
{{- end }}
{{- if $urlPrefix }}
-urlPrefix={{ $urlPrefix }}{{- if .Values.admin.extraArgs }} \{{ end }}
-urlPrefix={{ $urlPrefix }} \
{{- end }}
{{- if .Values.admin.allowInsecureBind }}
-allowInsecureBind \
{{- end }}
{{- range $index, $arg := .Values.admin.extraArgs }}
{{ $arg }}{{- if lt $index (sub (len $.Values.admin.extraArgs) 1) }} \{{ end }}
@@ -37,13 +37,17 @@ spec:
{{- with .Values.allInOne.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $podAnnotations := mergeOverwrite (deepCopy (.Values.podAnnotations | default dict)) (.Values.allInOne.podAnnotations | default dict) }}
{{- $existingS3ConfigSecret := or .Values.allInOne.s3.existingConfigSecret .Values.s3.existingConfigSecret .Values.filer.s3.existingConfigSecret }}
{{- if $existingS3ConfigSecret }}
{{- $configSecret := (lookup "v1" "Secret" .Release.Namespace $existingS3ConfigSecret) | default dict }}
{{- $_ := set $podAnnotations "checksum/s3config" ($configSecret | toYaml | sha256sum) }}
{{- else }}
{{- $_ := set $podAnnotations "checksum/s3config" (include (print .Template.BasePath "/s3/s3-secret.yaml") . | sha256sum) }}
{{- end }}
{{- $_ := set $podAnnotations "checksum/master-config" (include (print .Template.BasePath "/master/master-configmap.yaml") . | sha256sum) }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.allInOne.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- toYaml $podAnnotations | nindent 8 }}
spec:
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.allInOne.restartPolicy }}
{{- if .Values.allInOne.affinity }}
@@ -24,6 +24,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer
{{- with .Values.filer.ingresses.grpc.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if $securityEnabled }}
tls:
@@ -29,6 +29,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer
{{- with .Values.filer.ingresses.http.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.http.className }}
ingressClassName: {{ .Values.filer.ingresses.http.className | quote }}
@@ -87,6 +90,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer
{{- with .Values.filer.ingresses.grpc.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.filer.ingresses.grpc.className }}
ingressClassName: {{ .Values.filer.ingresses.grpc.className | quote }}
@@ -43,19 +43,15 @@ spec:
{{- with .Values.filer.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.filer.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $podAnnotations := mergeOverwrite (deepCopy (.Values.podAnnotations | default dict)) (.Values.filer.podAnnotations | default dict) }}
{{- if .Values.filer.s3.existingConfigSecret }}
{{- $configSecret := (lookup "v1" "Secret" .Release.Namespace .Values.filer.s3.existingConfigSecret) | default dict }}
checksum/s3config: {{ $configSecret | toYaml | sha256sum }}
{{- $configSecret := (lookup "v1" "Secret" .Release.Namespace .Values.filer.s3.existingConfigSecret) | default dict }}
{{- $_ := set $podAnnotations "checksum/s3config" ($configSecret | toYaml | sha256sum) }}
{{- else }}
checksum/s3config: {{ include (print .Template.BasePath "/s3/s3-secret.yaml") . | sha256sum }}
{{- $_ := set $podAnnotations "checksum/s3config" (include (print .Template.BasePath "/s3/s3-secret.yaml") . | sha256sum) }}
{{- end }}
annotations:
{{- toYaml $podAnnotations | nindent 8 }}
spec:
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.filer.restartPolicy }}
{{- if .Values.filer.affinity }}
@@ -21,6 +21,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: master
{{- with .Values.master.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.master.ingress.className | quote }}
tls:
@@ -43,13 +43,10 @@ spec:
{{- with .Values.master.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $podAnnotations := mergeOverwrite (deepCopy (.Values.podAnnotations | default dict)) (.Values.master.podAnnotations | default dict) }}
{{- $_ := set $podAnnotations "checksum/master-config" (include (print .Template.BasePath "/master/master-configmap.yaml") . | sha256sum) }}
annotations:
{{ with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.master.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- toYaml $podAnnotations | nindent 8 }}
spec:
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.master.restartPolicy }}
{{- if .Values.master.affinity }}
@@ -35,13 +35,15 @@ spec:
{{- with .Values.s3.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- $podAnnotations := mergeOverwrite (deepCopy (.Values.podAnnotations | default dict)) (.Values.s3.podAnnotations | default dict) }}
{{- if .Values.s3.existingConfigSecret }}
{{- $configSecret := (lookup "v1" "Secret" .Release.Namespace .Values.s3.existingConfigSecret) | default dict }}
{{- $_ := set $podAnnotations "checksum/s3config" ($configSecret | toYaml | sha256sum) }}
{{- else }}
{{- $_ := set $podAnnotations "checksum/s3config" (include (print .Template.BasePath "/s3/s3-secret.yaml") . | sha256sum) }}
{{- end }}
annotations:
{{ with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.s3.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- toYaml $podAnnotations | nindent 8 }}
spec:
restartPolicy: {{ default .Values.global.seaweedfs.restartPolicy .Values.s3.restartPolicy }}
{{- if .Values.s3.affinity }}
@@ -41,6 +41,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: s3-iceberg
{{- with .Values.s3.icebergIngress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.s3.icebergIngress.className }}
ingressClassName: {{ .Values.s3.icebergIngress.className | quote }}
@@ -32,6 +32,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: s3
{{- with .Values.s3.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.s3.ingress.className | quote }}
tls:
@@ -41,6 +41,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: s3-lance
{{- with .Values.s3.lanceIngress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.s3.lanceIngress.className }}
ingressClassName: {{ .Values.s3.lanceIngress.className | quote }}
@@ -60,7 +60,7 @@ stringData:
read_access_key_id: {{ $access_key_read }}
read_secret_access_key: {{ $secret_key_read }}
{{- end }}
seaweedfs_s3_config: '{"identities":[{"name":"anvAdmin","credentials":[{"accessKey":"{{ $access_key_admin }}","secretKey":"{{ $secret_key_admin }}"}],"actions":["Admin","Read","Write"]},{"name":"anvReadOnly","credentials":[{"accessKey":"{{ $access_key_read }}","secretKey":"{{ $secret_key_read }}"}],"actions":["Read"]}]}'
seaweedfs_s3_config: '{"identities":[{"name":"anvAdmin","credentials":[{"accessKey":"{{ $access_key_admin }}","secretKey":"{{ $secret_key_admin }}"}],"actions":["Admin","Read","Write"]},{"name":"anvReadOnly","credentials":[{"accessKey":"{{ $access_key_read }}","secretKey":"{{ $secret_key_read }}"}],"actions":["Read","List"]}]}'
{{- if .Values.filer.s3.auditLogConfig }}
filer_s3_auditLogConfig.json: |
{{ toJson .Values.filer.s3.auditLogConfig | nindent 4 }}
@@ -88,6 +88,43 @@ true
{{- end -}}
{{- end -}}
{{/* Classify an admin bind address as loopback, mirroring weed admin's
isLoopbackIp (net.ParseIP + IsLoopback). Helm templates cannot call
net.ParseIP, so we approximate: valid IPv4 addresses in 127.0.0.0/8
(validated via regex to reject malformed values like "127.not-an-ip")
and the IPv6 loopback "::1" / its expanded form "0:0:0:0:0:0:0:1" are
loopback. Hostnames (e.g. "localhost") and wildcard addresses
("0.0.0.0", "::") are non-loopback, matching the binary, which
treats unparseable hostnames as non-loopback to be safe. Other IPv6
loopback representations are not matched; the binary's own runtime
validation is the authoritative guard. */}}
{{- define "seaweedfs.admin.isLoopbackIp" -}}
{{- $ip := toString . -}}
{{- if or (regexMatch "^127\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$" $ip) (eq $ip "::1") (eq $ip "0:0:0:0:0:0:0:1") -}}
true
{{- end -}}
{{- end -}}
{{/* Whether the admin non-loopback bind guard is satisfied: admin.secret
(adminPassword or existingSecret), WEED_ADMIN_PASSWORD via
extraEnvironmentVars / secretExtraEnvironmentVars, or
admin.allowInsecureBind. A secret-backed entry counts as enabled even
though the chart cannot read its value. */}}
{{- define "seaweedfs.admin.authEnabled" -}}
{{- if or .Values.admin.secret.existingSecret .Values.admin.secret.adminPassword .Values.admin.allowInsecureBind -}}
true
{{- else -}}
{{- $merged := dict -}}
{{- $_ := include "seaweedfs.mergeExtraEnvironmentVars" (dict "global" .Values.global.seaweedfs "component" .Values.admin "target" $merged) -}}
{{- $envPassword := index $merged "WEED_ADMIN_PASSWORD" -}}
{{- if or (kindIs "map" $envPassword) (hasKey (.Values.admin.secretExtraEnvironmentVars | default dict) "WEED_ADMIN_PASSWORD") -}}
true
{{- else if and $envPassword (ne (toString $envPassword) "") -}}
true
{{- end -}}
{{- end -}}
{{- end -}}
{{/* Return the proper filer image */}}
{{- define "seaweedfs.filer.image" -}}
{{- if .Values.filer.imageOverride -}}
@@ -27,6 +27,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: volume
{{- with .Values.volume.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) .Values.volume.ingress.className }}
ingressClassName: {{ .Values.volume.ingress.className | quote }}
@@ -55,7 +55,7 @@ global:
gatewayHost: null
gatewayPort: null
additionalLabels: {}
# if enabled will use global.seaweedfs.replicationPlacement and override master & filer defaultReplicaPlacement config
# if enabled will use global.seaweedfs.replicationPlacement and override master.defaultReplication & filer.defaultReplicaPlacement config
enableReplication: false
# replication type is XYZ:
# X number of replica in other data centers
@@ -190,6 +190,8 @@ master:
podLabels: {}
# Annotations to be added to the master pods
# The chart sets checksum/master-config on master pods; other checksum/* keys
# can be used for custom rollouts.
podAnnotations: {}
# Annotations to be added to the master resources
@@ -276,6 +278,7 @@ master:
host: "master.seaweedfs.local"
path: "/sw-master/?(.*)"
pathType: ImplementationSpecific
labels: {}
annotations: {}
# nginx.ingress.kubernetes.io/auth-type: "basic"
# nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
@@ -600,6 +603,7 @@ volume:
host: "volume.seaweedfs.local"
path: "/"
pathType: Prefix
labels: {}
annotations:
nginx.ingress.kubernetes.io/app-root: /ui/index.html
# nginx.ingress.kubernetes.io/use-regex: "true"
@@ -771,6 +775,8 @@ filer:
podLabels: {}
# Annotations to be added to the filer pods
# The chart sets checksum/s3config on filer pods; other checksum/* keys can be
# used for custom rollouts.
podAnnotations: {}
# Annotations to be added to the filer resource
@@ -858,6 +864,7 @@ filer:
host: "seaweedfs.cluster.local"
path: "/sw-filer/?(.*)"
pathType: ImplementationSpecific
labels: {}
annotations: {}
# nginx.ingress.kubernetes.io/backend-protocol: GRPC
# nginx.ingress.kubernetes.io/auth-type: "basic"
@@ -884,6 +891,7 @@ filer:
# whole host, not the HTTP UI's regex path.
path: "/"
pathType: Prefix
labels: {}
annotations:
# Ingress terminates TLS and re-originates gRPC (HTTP/2) to the filer.
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
@@ -1074,6 +1082,8 @@ s3:
podLabels: {}
# Annotations to be added to the s3 pods
# The chart sets checksum/s3config on s3 pods; other checksum/* keys can be
# used for custom rollouts.
podAnnotations: {}
# Annotations to be added to the s3 resources
@@ -1180,6 +1190,7 @@ s3:
host: "seaweedfs.cluster.local"
path: "/"
pathType: Prefix
labels: {}
# additional ingress annotations for the s3 endpoint
annotations: {}
tls: []
@@ -1205,6 +1216,7 @@ s3:
host: "seaweedfs-iceberg.cluster.local"
path: "/"
pathType: Prefix
labels: {}
annotations: {}
tls: []
@@ -1214,6 +1226,7 @@ s3:
host: "seaweedfs-lance.cluster.local"
path: "/"
pathType: Prefix
labels: {}
annotations: {}
tls: []
@@ -1321,8 +1334,26 @@ admin:
replicas: 1
port: 23646 # Default admin port
grpcPort: 33646 # Default gRPC port for worker connections
# IP address the admin server listens on. Since `weed admin` 4.46 defaults to
# loopback (127.0.0.1), the chart must bind a non-loopback address for the
# kubelet's httpGet readiness/liveness probes (which dial the pod IP) to ever
# succeed. "0.0.0.0" restores the pre-4.46 behaviour of listening on all
# interfaces. A non-loopback address requires authentication: set
# admin.secret.adminPassword or admin.secret.existingSecret, supply
# WEED_ADMIN_PASSWORD via admin.extraEnvironmentVars /
# admin.secretExtraEnvironmentVars, or opt out with admin.allowInsecureBind;
# otherwise the admin container will exit with a clear error rather than
# silently staying unready. The whole
# 127.0.0.0/8 range and ::1 are treated as loopback (matching weed admin).
# Set to a loopback address only if you also replace the httpGet probes.
# Note: the -ip flag requires SeaweedFS 4.46 or newer; pinning
# admin.imageOverride to an older image is not supported with this chart.
ip: "0.0.0.0"
loggingOverrideLevel: null
# INSECURE: allow binding a non-loopback ip without authentication.
allowInsecureBind: false
# Admin authentication
secret:
# Name of an existing secret containing admin credentials. If set, adminUser and adminPassword below are ignored.
@@ -1445,6 +1476,7 @@ admin:
host: "admin.seaweedfs.local"
path: "/"
pathType: Prefix
labels: {}
annotations: {}
tls: []
@@ -1766,6 +1798,8 @@ allInOne:
initContainers: "" # Init containers
sidecars: "" # Sidecar containers
annotations: {} # Annotations for the deployment
# The chart sets checksum/master-config and checksum/s3config on all-in-one
# pods; other checksum/* keys can be used for custom rollouts.
podAnnotations: {} # Annotations for the pods
podLabels: {} # Labels for the pods
@@ -1900,6 +1934,9 @@ certificates:
# Labels to be added to all the created pods
podLabels: {}
# Annotations to be added to all the created pods
# The chart sets checksum/master-config and checksum/s3config on pods whose
# rendered ConfigMaps or Secrets should trigger rollouts. Other checksum/* keys
# can be used for custom rollout annotations.
podAnnotations: {}
networkPolicy:
@@ -16,22 +16,13 @@
# seaweedfs/seaweedfs#11674 after 4.48; drop the patch on the first vendored
# release that carries it.
#
# patches/volume-layout-crowded-lock.diff makes SetVolumeCrowded take the write
# lock of the volume layout. Upstream 4.45 mutates the crowded map under the
# read lock, while Assign reads it under the same read lock through
# GetWritableVolumeCount, so under a steady stream of writes the master dies on
# a fatal "concurrent map read and map write", which recover cannot catch, and
# S3 answers 500 until it is back. Backport of seaweedfs/seaweedfs#11216,
# released in 4.46; drop the patch on the first vendored release that carries
# it.
#
# `make update` re-pins VERSION from the vendored chart, SOURCE_SHA256 from the
# source archive of that tag, UPSTREAM_DIGEST from the upstream image of that
# tag and the builder from upstream's docker/Dockerfile.go_build, and checks
# that the patches still apply.
ARG VERSION=4.45
ARG SOURCE_SHA256=800a91693e2a4e974ef0e2a157b6a04eff9f4df507303b1cff31b0601081fc30
ARG UPSTREAM_DIGEST=sha256:fc9f76fa993ad69966ffeb2f65d0318fcae39c6f8e20cf68ef7b3a5cb97769e5
ARG VERSION=4.48
ARG SOURCE_SHA256=93199495e93a981451d1fefecb5aa71e12aa1692093eed2338bbfe7f08960bfb
ARG UPSTREAM_DIGEST=sha256:4e61d15fd35994cb1e43e1e553dff106794841fd9a99ade2fc8c8bfce4d7872d
# The Go toolchain of upstream's builder (docker/Dockerfile.go_build), which
# compiles the upstream weed.
@@ -1,87 +0,0 @@
diff --git a/weed/topology/crowded_writable_test.go b/weed/topology/crowded_writable_test.go
--- a/weed/topology/crowded_writable_test.go
+++ b/weed/topology/crowded_writable_test.go
@@ -1,6 +1,7 @@
package topology
import (
+ "sync"
"testing"
"time"
@@ -73,3 +74,52 @@ func TestCrowdedCountStillMatchesWritables(t *testing.T) {
t.Errorf("writable=%d crowded=%d, want 1 and 1", writable, crowded)
}
}
+
+// SetVolumeCrowded mutates the crowded map while GetWritableVolumeCount reads
+// it on the Assign hot path. Under RLock both could run at once and the Go
+// runtime aborts with "concurrent map read and map write". Run with -race to
+// reproduce the original bug; the write lock makes this pass.
+func TestSetVolumeCrowdedNoRaceWithGetWritableVolumeCount(t *testing.T) {
+ rp, _ := super_block.NewReplicaPlacementFromString("000")
+ vl := NewVolumeLayout(rp, needle.EMPTY_TTL, types.HardDriveType, 10000, false)
+ // GetWritableVolumeCount iterates vl.writables, so give it something to
+ // read while the crowded map is being mutated.
+ vl.writables = []needle.VolumeId{1, 2, 3}
+
+ var wg sync.WaitGroup
+ stop := make(chan struct{})
+ for range 8 {
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ for {
+ select {
+ case <-stop:
+ return
+ default:
+ vl.SetVolumeCrowded(needle.VolumeId(2))
+ }
+ }
+ }()
+ }
+ for range 8 {
+ wg.Add(1)
+ go func() {
+ defer wg.Done()
+ for {
+ select {
+ case <-stop:
+ return
+ default:
+ vl.GetWritableVolumeCount()
+ }
+ }
+ }()
+ }
+
+ // The race detector needs only a brief window to flag a concurrent
+ // map read/write; let the goroutines hammer the lock briefly.
+ time.Sleep(50 * time.Millisecond)
+ close(stop)
+ wg.Wait()
+}
diff --git a/weed/topology/volume_layout.go b/weed/topology/volume_layout.go
--- a/weed/topology/volume_layout.go
+++ b/weed/topology/volume_layout.go
@@ -1019,11 +1019,14 @@ func (vl *VolumeLayout) setVolumeCrowded(vid needle.VolumeId) {
}
func (vl *VolumeLayout) SetVolumeCrowded(vid needle.VolumeId) {
- // since delete is guarded by accessLock.Lock(),
- // and is always called in sequential order,
- // RLock() should be safe enough
- vl.accessLock.RLock()
- defer vl.accessLock.RUnlock()
+ // setVolumeCrowded mutates the crowded map, and GetWritableVolumeCount
+ // reads it under RLock on the Assign hot path. Two concurrent RLock
+ // holders with one writing the map triggers a fatal
+ // "concurrent map read and map write". Take the write lock: this path
+ // is a low-frequency single consumer driven by the crowded-volume
+ // event loop, and every other mutation of crowded already holds Lock().
+ vl.accessLock.Lock()
+ defer vl.accessLock.Unlock()
vl.setVolumeCrowded(vid)
}
@@ -1,24 +0,0 @@
diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml
index a067e1de9..17b82cca0 100644
--- a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml
+++ b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml
@@ -97,6 +97,19 @@ data:
cert = "/usr/local/share/ca-certificates/worker/tls.crt"
key = "/usr/local/share/ca-certificates/worker/tls.key"
+ {{- /* S3 gRPC server identity (weed s3 -port.grpc, default httpPort+10000).
+ Without this section, LoadServerTLS("grpc.s3") returns nil and the S3
+ server serves its internal gRPC (IAM cache propagation, s3 lifecycle
+ delete RPCs) as plaintext, while peers dial it with mTLS credentials:
+ "tls: first record does not look like a TLS handshake".
+ Always uses the internal CA-signed client certificate (already mounted
+ on s3 pods by s3-deployment.yaml). Deliberately NOT s3.tlsSecret: that
+ secret is for the public HTTPS listener and may be issued by a public
+ CA which internal gRPC peers (trusting only grpc.ca) would reject. */}}
+ [grpc.s3]
+ cert = "/usr/local/share/ca-certificates/client/tls.crt"
+ key = "/usr/local/share/ca-certificates/client/tls.key"
+
# use this for any place needs a grpc client
# i.e., "weed backup|benchmark|filer.copy|filer.replicate|mount|s3|upload"
[grpc.client]
@@ -8,6 +8,7 @@ suite: seaweedfs image
templates:
- charts/seaweedfs/templates/master/master-statefulset.yaml
- charts/seaweedfs/templates/master/master-configmap.yaml
- charts/seaweedfs/templates/volume/volume-statefulset.yaml
- charts/seaweedfs/templates/filer/filer-statefulset.yaml
- charts/seaweedfs/templates/s3/s3-deployment.yaml
@@ -14,6 +14,43 @@ release:
namespace: tenant-root
tests:
- it: refuses a non-loopback admin without authentication
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
set:
seaweedfs:
global:
seaweedfs:
extraEnvironmentVars: null
admin: &unauthenticatedAdmin
enabled: true
ip: "0.0.0.0"
allowInsecureBind: false
secret:
existingSecret: ""
adminPassword: ""
extraEnvironmentVars: null
secretExtraEnvironmentVars: null
asserts:
- failedTemplate:
errorPattern: 'admin\.ip is set to "0\.0\.0\.0" \(non-loopback\) but admin authentication is not configured\.'
- it: allows an explicitly unauthenticated non-loopback admin
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
set:
seaweedfs:
global:
seaweedfs:
extraEnvironmentVars: null
admin:
<<: *unauthenticatedAdmin
allowInsecureBind: true
asserts:
- isKind:
of: StatefulSet
- matchRegex:
path: spec.template.spec.containers[0].command[2]
pattern: '-allowInsecureBind '
- it: runs the admin server that schedules lifecycle jobs
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
set: &enabled
@@ -47,6 +84,17 @@ tests:
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
value: 1Gi
# weed admin keeps its worker gRPC port on loopback unless -ip is given
# explicitly (weed/command/admin.go at 4.48), and the worker runs in its own
# pod.
- it: lets the worker reach the admin gRPC port
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
set: *enabled
asserts:
- matchRegex:
path: spec.template.spec.containers[0].command[2]
pattern: '-ip=0\.0\.0\.0 '
- it: runs the worker against the admin of the same release
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
set: *enabled
@@ -12,6 +12,7 @@ suite: seaweedfs master anti-affinity
templates:
- charts/seaweedfs/templates/master/master-statefulset.yaml
- charts/seaweedfs/templates/master/master-configmap.yaml
release:
name: seaweedfs
@@ -19,6 +20,7 @@ release:
tests:
- it: softens the master hostname anti-affinity to a preference
template: charts/seaweedfs/templates/master/master-statefulset.yaml
asserts:
- notExists:
path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution
@@ -13,6 +13,7 @@ suite: seaweedfs master probe timeouts
templates:
- charts/seaweedfs/templates/master/master-statefulset.yaml
- charts/seaweedfs/templates/master/master-configmap.yaml
release:
name: seaweedfs
@@ -20,6 +21,7 @@ release:
tests:
- it: raises both master probe timeouts above the cluster-status backoff
template: charts/seaweedfs/templates/master/master-statefulset.yaml
asserts:
- equal:
path: spec.template.spec.containers[0].livenessProbe.timeoutSeconds
@@ -29,6 +31,7 @@ tests:
value: 30
- it: preserves the other master probe fields through the deep-merge
template: charts/seaweedfs/templates/master/master-statefulset.yaml
asserts:
# liveness: only timeoutSeconds is overridden, the rest survive
- equal:
@@ -14,6 +14,7 @@ suite: seaweedfs s3 catalog listener ports
templates:
- charts/seaweedfs/templates/s3/s3-service.yaml
- charts/seaweedfs/templates/s3/s3-deployment.yaml
- charts/seaweedfs/templates/s3/s3-secret.yaml
release:
name: seaweedfs
@@ -3,6 +3,7 @@ suite: seaweedfs s3 gRPC listener speaks mTLS
templates:
- charts/seaweedfs/templates/shared/security-configmap.yaml
- charts/seaweedfs/templates/s3/s3-deployment.yaml
- charts/seaweedfs/templates/s3/s3-secret.yaml
release:
name: seaweedfs-system
@@ -12,7 +13,7 @@ tests:
# weed s3 serves its internal gRPC (the LifecycleDelete RPC among it) with
# the [grpc.s3] identity and as plaintext without one, while the worker dials
# it with [grpc.worker] mTLS credentials, so every delete failed the TLS
# handshake. patches/s3-grpc-tls.patch backports the section from upstream.
# handshake. The vendored chart carries the section since 4.46.
- it: gives the s3 gRPC server a TLS identity signed by the internal CA
template: charts/seaweedfs/templates/shared/security-configmap.yaml
asserts:
@@ -19,6 +19,7 @@ suite: seaweedfs s3 TLS on main port + COSI provisioner SA name
templates:
- charts/seaweedfs/templates/s3/s3-deployment.yaml
- charts/seaweedfs/templates/s3/s3-secret.yaml
- charts/seaweedfs/templates/cosi/cosi-deployment.yaml
release:
@@ -7,6 +7,7 @@ suite: seaweedfs claims keep the storage class a string
templates:
- charts/seaweedfs/templates/master/master-statefulset.yaml
- charts/seaweedfs/templates/master/master-configmap.yaml
- charts/seaweedfs/templates/filer/filer-statefulset.yaml
- charts/seaweedfs/templates/volume/volume-statefulset.yaml
- charts/seaweedfs/templates/admin/admin-statefulset.yaml
@@ -97,6 +98,7 @@ tests:
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
set:
seaweedfs.admin.enabled: true
seaweedfs.admin.secret.existingSecret: seaweedfs-admin-credentials
seaweedfs.admin.logs: {type: persistentVolumeClaim, size: 1Gi, storageClass: "456"}
asserts:
- equal:
@@ -107,6 +109,7 @@ tests:
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
set:
seaweedfs.admin.enabled: true
seaweedfs.admin.secret.existingSecret: seaweedfs-admin-credentials
seaweedfs.admin.logs: {type: persistentVolumeClaim, size: 1Gi}
asserts:
- notExists:
@@ -28,6 +28,7 @@ suite: seaweedfs volume slot ceiling
templates:
- charts/seaweedfs/templates/master/master-statefulset.yaml
- charts/seaweedfs/templates/master/master-configmap.yaml
- charts/seaweedfs/templates/volume/volume-statefulset.yaml
release:
+3 -3
View File
@@ -207,9 +207,9 @@ seaweedfs:
# weed skip startLanceServer and drops the container port and Service port
# with it.
lancePort: 0
# patches/s3-grpc-tls.patch adds [grpc.s3] to security.toml, which the s3
# pods mount by subPath and so never re-read. This annotation changes the
# pod template in the release that brings the section, so an upgrade
# The chart adds [grpc.s3] to security.toml, which the s3 pods mount by
# subPath and so never re-read. This annotation changes the pod
# template in the release that brings the section, so an upgrade
# restarts s3 onto it instead of leaving its gRPC in plaintext. The
# upstream s3 template carries no checksum of that ConfigMap, and adding
# one would be another vendored patch for a change made once.