Skip to content

Commit caf854e

Browse files
akagami-harshsahil9001juliusvonkohout
authored
Add pod postStart lifecycle for SeaweedFS and remove Job initializer (#12387)
* feat: added fix for flaky test Signed-off-by: Sahil Silare <[email protected]> * feat: removed create admin user job to avoid race Signed-off-by: Sahil Silare <[email protected]> * feat: fixed indentation Signed-off-by: Sahil Silare <[email protected]> * chore: fixed indentation Signed-off-by: Sahil Silare <[email protected]> * chore: removed reference from kustomization.yaml Signed-off-by: Sahil Silare <[email protected]> * Update seaweedfs-deployment.yaml Signed-off-by: Julius von Kohout <[email protected]> * fall back to seaweedfs 3.92 Signed-off-by: Harshvir Potpose <[email protected]> --------- Signed-off-by: Sahil Silare <[email protected]> Signed-off-by: Julius von Kohout <[email protected]> Signed-off-by: Harshvir Potpose <[email protected]> Co-authored-by: Sahil Silare <[email protected]> Co-authored-by: Julius von Kohout <[email protected]>
1 parent 2ccd057 commit caf854e

File tree

3 files changed

+29
-86
lines changed

3 files changed

+29
-86
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ resources:
66
- seaweedfs-deployment.yaml
77
- seaweedfs-pvc.yaml
88
- seaweedfs-networkpolicy.yaml
9-
- seaweedfs-create-admin-user-job.yaml
109
- seaweedfs-service.yaml
1110
- seaweedfs-service-account.yaml
1211
- minio-service.yaml

manifests/kustomize/third-party/seaweedfs/base/seaweedfs/seaweedfs-create-admin-user-job.yaml

Lines changed: 0 additions & 77 deletions
This file was deleted.

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

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,35 @@ spec:
2424
type: RuntimeDefault
2525
containers:
2626
- name: seaweedfs
27-
image: 'chrislusf/seaweedfs:3.92'
27+
envFrom:
28+
- secretRef:
29+
name: mlpipeline-minio-artifact
30+
image: "chrislusf/seaweedfs:3.92"
2831
args:
29-
- 'server'
30-
- '-dir=/data'
31-
- '-s3'
32-
- '-iam'
33-
- '-filer'
34-
- '-master.volumePreallocate=false'
32+
- "server"
33+
- "-dir=/data"
34+
- "-s3"
35+
- "-iam"
36+
- "-filer"
37+
- "-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
3556
ports:
3657
- containerPort: 8333
3758
- containerPort: 8111
@@ -48,7 +69,7 @@ spec:
4869
successThreshold: 1
4970
failureThreshold: 100
5071
timeoutSeconds: 10
51-
securityContext: # Using restricted profile
72+
securityContext: # Using restricted profile
5273
allowPrivilegeEscalation: false
5374
privileged: false
5475
runAsNonRoot: true

0 commit comments

Comments
 (0)