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
Update Helm hook annotations for post-install and upgrade (#8150)
Emanuele Leopardi51ef39fc76dd
diff --git a/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml b/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yamlindex 269919d198..930c474e95 100644--- a/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml+++ b/k8s/charts/seaweedfs/templates/shared/post-install-bucket-hook.yaml@@ -15,14 +15,18 @@{{- $existingConfigSecret = or .Values.allInOne.s3.existingConfigSecret .Values.s3.existingConfigSecret .Values.filer.s3.existingConfigSecret }}{{- end }}{{- else if .Values.master.enabled }}- {{- /* Check standalone filer.s3 mode */}}- {{- if .Values.filer.s3.enabled }}+ {{- /* Check if embedded (in filer) or standalone S3 gateway is enabled */}}+ {{- if or .Values.filer.s3.enabled .Values.s3.enabled }}{{- $s3Enabled = true }}- {{- if .Values.filer.s3.createBuckets }}+ {{- if .Values.s3.createBuckets }}+ {{- $createBuckets = .Values.s3.createBuckets }}+ {{- $enableAuth = .Values.s3.enableAuth }}+ {{- $existingConfigSecret = .Values.s3.existingConfigSecret }}+ {{- else if .Values.filer.s3.createBuckets }}{{- $createBuckets = .Values.filer.s3.createBuckets }}+ {{- $enableAuth = .Values.filer.s3.enableAuth }}+ {{- $existingConfigSecret = .Values.filer.s3.existingConfigSecret }}{{- end }}- {{- $enableAuth = .Values.filer.s3.enableAuth }}- {{- $existingConfigSecret = .Values.filer.s3.existingConfigSecret }}{{- end }}{{- end }}@@ -36,7 +40,7 @@ metadata:app.kubernetes.io/managed-by: {{ .Release.Service | quote }}app.kubernetes.io/instance: {{ .Release.Name | quote }}annotations:- "helm.sh/hook": post-install+ "helm.sh/hook": post-install,post-upgrade"helm.sh/hook-weight": "-5""helm.sh/hook-delete-policy": hook-succeededspec:@@ -105,9 +109,12 @@ spec:wait_for_service "http://$WEED_CLUSTER_SW_FILER{{ .Values.filer.readinessProbe.httpGet.path }}"{{- end }}{{- range $createBuckets }}- /bin/echo \- "s3.bucket.create --name {{ .name }}" |\- /usr/bin/weed shell+ if /bin/echo "s3.bucket.list" | /usr/bin/weed shell | awk '{print $1}' | grep -Fxq "{{ .name }}"; then+ echo "Bucket '{{ .name }}' already exists, skipping creation."+ else+ echo "Creating bucket '{{ .name }}'..."+ /bin/echo "s3.bucket.create --name {{ .name }}" | /usr/bin/weed shell+ fi{{- end }}{{- range $createBuckets }}{{- if .anonymousRead }}diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yamlindex 35befc3d18..f9d93dab6d 100644--- a/k8s/charts/seaweedfs/values.yaml+++ b/k8s/charts/seaweedfs/values.yaml@@ -891,7 +891,7 @@ filer:# should have a secret key called seaweedfs_s3_config with an inline json configureexistingConfigSecret: nullauditLogConfig: {}- # You may specify buckets to be created during the install process.+ # You may specify buckets to be created during the install or upgrade process.# Buckets may be exposed publicly by setting `anonymousRead` to `true`# createBuckets:# - name: bucket-a@@ -916,6 +916,13 @@ s3:# should have a secret key called seaweedfs_s3_config with an inline json configexistingConfigSecret: nullauditLogConfig: {}+ # You may specify buckets to be created during the install or upgrade process.+ # Buckets may be exposed publicly by setting `anonymousRead` to `true`+ # createBuckets:+ # - name: bucket-a+ # anonymousRead: true+ # - name: bucket-b+ # anonymousRead: false# Suffix of the host name, {bucket}.{domainName}domainName: ""