Skip to content

Commit 79dfd4a

Browse files
authored
Fix: Seaweedfs admin credentials not loaded after restart (#12460)
This reverts commit 17c7d75. Signed-off-by: Patrick Schönthaler <[email protected]>
1 parent ae81579 commit 79dfd4a

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

manifests/kustomize/third-party/seaweedfs/base/seaweedfs/seaweedfs-deployment.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,9 @@ spec:
2424
type: RuntimeDefault
2525
containers:
2626
- name: seaweedfs
27-
env:
28-
- name: AWS_ACCESS_KEY_ID
29-
valueFrom:
30-
secretKeyRef:
31-
name: mlpipeline-minio-artifact
32-
key: accesskey
33-
- name: AWS_SECRET_ACCESS_KEY
34-
valueFrom:
35-
secretKeyRef:
36-
name: mlpipeline-minio-artifact
37-
key: secretkey
27+
envFrom:
28+
- secretRef:
29+
name: mlpipeline-minio-artifact
3830
image: "chrislusf/seaweedfs:4.00"
3931
args:
4032
- "server"
@@ -43,6 +35,24 @@ spec:
4335
- "-iam"
4436
- "-filer"
4537
- "-master.volumePreallocate=false"
38+
lifecycle:
39+
postStart:
40+
exec:
41+
command:
42+
- /bin/sh
43+
- -ec
44+
- |
45+
# wait until seaweedfs master is ready
46+
for i in $(seq 1 120); do
47+
if wget -q --spider http://127.0.0.1:8333/status; then
48+
break
49+
fi
50+
sleep 2
51+
done
52+
# create bucket if not exists (ignore error if exists)
53+
echo "s3.bucket.create --name mlpipeline" | /usr/bin/weed shell || true
54+
# configure admin user using keys from secret
55+
echo "s3.configure -user kubeflow-admin -access_key $accesskey -secret_key $secretkey -actions Admin -apply" | /usr/bin/weed shell
4656
ports:
4757
- containerPort: 8333
4858
- containerPort: 8111

0 commit comments

Comments
 (0)