aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Roby <max@lil-mac.lan>2023-11-23 13:23:51 +0100
committerChris Lu <chrislusf@users.noreply.github.com>2023-11-24 06:40:19 -0800
commitf33f7c10f0781652d99b8b656d34e230f371e71c (patch)
tree91ee3fd19884021931d888c91b2f5502d9420556
parentac6158818b4d1b952c3a35c0978536c9a1a38e55 (diff)
downloadseaweedfs-f33f7c10f0781652d99b8b656d34e230f371e71c.tar.xz
seaweedfs-f33f7c10f0781652d99b8b656d34e230f371e71c.zip
trying to get anonymous access for buckets working
-rw-r--r--k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml11
-rw-r--r--k8s/charts/seaweedfs/values.yaml10
2 files changed, 15 insertions, 6 deletions
diff --git a/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml b/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml
index 6b0ce5f80..e375ab678 100644
--- a/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml
+++ b/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml
@@ -50,11 +50,18 @@ spec:
- "/bin/sh"
- "-ec"
- |
- {{- range $.Values.filer.s3.createBuckets }}
+ {{- range $reg, $props := $.Values.filer.s3.createBuckets }}
exec /bin/echo \
- "s3.bucket.create --name {{ . }}" |\
+ "s3.bucket.create --name {{ $props.name }}" |\
/usr/bin/weed shell
{{- end }}
+ {{- range $reg, $props := $.Values.filer.s3.createBuckets }}
+ {{- if $props.anonymousRead }}
+ exec /bin/echo \
+ "s3.configure --user anonymous --buckets {{ $props.name }}" |\
+ /usr/bin/weed shell
+ {{- end }}
+ {{- end }}
ports:
- containerPort: {{ .Values.master.port }}
name: swfs-master
diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml
index 5f2359250..0a76a4436 100644
--- a/k8s/charts/seaweedfs/values.yaml
+++ b/k8s/charts/seaweedfs/values.yaml
@@ -579,12 +579,14 @@ filer:
# You may specify buckets and users to be created during the install process
# The user's credentials must be in an existing secret using the key names:
# 'ACCESS_KEY_ID' and 'ACCESS_SECRET_KEY'
- #createBuckets:
- # - bucket-a
- # - bucket-b
+ # createBuckets:
+ # - name: bucket-a
+ # anonymousRead: true
+ # - name: bucket-b
+ # anonymousRead: false
# createUsers:
# - name: friend
- # actions: "read,write,list"
+ # actions: "Read,Write,List"
# buckets: "bucket-b"
# secretName: friend_s3_creds