SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
helm: expose s3 update strategy, lifecycle, and termination grace period (#11602)
Peter Dodd8ebef0350955
diff --git a/.github/workflows/helm_ci.yml b/.github/workflows/helm_ci.ymlindex b26451f5a4..a08b8c23a2 100644--- a/.github/workflows/helm_ci.yml+++ b/.github/workflows/helm_ci.yml@@ -57,7 +57,25 @@ jobs:helm template test $CHART_DIR --set s3.enabled=true > /tmp/s3.yamlgrep -q "kind: Deployment" /tmp/s3.yaml && grep -q "seaweedfs-s3" /tmp/s3.yamlecho "S3 deployment renders correctly"-++ echo "=== Testing S3 rollout settings ==="+ helm template test $CHART_DIR --show-only templates/s3/s3-deployment.yaml \+ --set s3.enabled=true > /tmp/s3-rollout-defaults.yaml+ grep -q "terminationGracePeriodSeconds: 10$" /tmp/s3-rollout-defaults.yaml+ test "$(grep -cE '^ strategy:|^ +lifecycle:' /tmp/s3-rollout-defaults.yaml)" -eq 0+ helm template test $CHART_DIR --show-only templates/s3/s3-deployment.yaml \+ --set s3.enabled=true \+ --set s3.terminationGracePeriodSeconds=30 \+ --set s3.updateStrategy.type=RollingUpdate \+ --set s3.updateStrategy.rollingUpdate.maxUnavailable=0 \+ --set-string 's3.lifecycle.preStop.exec.command={sleep,5}' \+ > /tmp/s3-rollout.yaml+ grep -q "terminationGracePeriodSeconds: 30$" /tmp/s3-rollout.yaml+ grep -A 4 "^ strategy:" /tmp/s3-rollout.yaml | grep -q "maxUnavailable: 0"+ grep -A 4 "^ strategy:" /tmp/s3-rollout.yaml | grep -q "type: RollingUpdate"+ grep -A 5 "^ lifecycle:" /tmp/s3-rollout.yaml | grep -q -- "- sleep"+ echo "S3 rollout settings render correctly"+echo "=== Testing S3 credentials from an existing secret ==="credential_args=(--set s3.credentials.admin.existingSecret=minio-rootdiff --git a/k8s/charts/seaweedfs/templates/s3/s3-deployment.yaml b/k8s/charts/seaweedfs/templates/s3/s3-deployment.yamlindex 4fd499401f..8a2f744a0c 100644--- a/k8s/charts/seaweedfs/templates/s3/s3-deployment.yaml+++ b/k8s/charts/seaweedfs/templates/s3/s3-deployment.yaml@@ -17,6 +17,10 @@ metadata:{{- end }}spec:replicas: {{ .Values.s3.replicas }}+ {{- with .Values.s3.updateStrategy }}+ strategy:+ {{- toYaml . | nindent 4 }}+ {{- end }}selector:matchLabels:app.kubernetes.io/name: {{ template "seaweedfs.name" . }}@@ -59,7 +63,7 @@ spec:{{ tpl .Values.s3.tolerations . | nindent 8 | trim }}{{- end }}{{- include "seaweedfs.imagePullSecrets" . | nindent 6 }}- terminationGracePeriodSeconds: 10+ terminationGracePeriodSeconds: {{ .Values.s3.terminationGracePeriodSeconds }}{{- if .Values.s3.priorityClassName }}priorityClassName: {{ .Values.s3.priorityClassName | quote }}{{- end }}@@ -235,6 +239,10 @@ spec:failureThreshold: {{ .Values.s3.livenessProbe.failureThreshold }}timeoutSeconds: {{ .Values.s3.livenessProbe.timeoutSeconds }}{{- end }}+ {{- with .Values.s3.lifecycle }}+ lifecycle:+ {{- toYaml . | nindent 12 }}+ {{- end }}{{- with .Values.s3.resources }}resources:{{- toYaml . | nindent 12 }}diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yamlindex 3f7c56d070..1a6315d050 100644--- a/k8s/charts/seaweedfs/values.yaml+++ b/k8s/charts/seaweedfs/values.yaml@@ -1035,6 +1035,17 @@ s3:imageOverride: nullrestartPolicy: nullreplicas: 1+ # Deployment update strategy, rendered as the Deployment's strategy+ # ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy+ # Example:+ # updateStrategy:+ # type: RollingUpdate+ # rollingUpdate:+ # maxUnavailable: 0+ # maxSurge: 25%+ updateStrategy: {}+ # Time the s3 pod is given to shut down, including any preStop hook+ terminationGracePeriodSeconds: 10bindAddress: 0.0.0.0port: 8333# add additional https port@@ -1227,6 +1238,17 @@ s3:failureThreshold: 100timeoutSeconds: 10+ # Lifecycle hooks for the s3 container. A preStop sleep lets the pod leave+ # the Service endpoints before it receives SIGTERM; keep it shorter than+ # terminationGracePeriodSeconds.+ # ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/+ # Example:+ # lifecycle:+ # preStop:+ # exec:+ # command: ["sleep", "5"]+ lifecycle: {}+createBucketsHook:resources: {}