Skip to content

Commit 00e3a67

Browse files
committed
test: add jindo multi-oss secret projection e2e
Signed-off-by: CAICAIIs <3360776475@qq.com>
1 parent 88964aa commit 00e3a67

9 files changed

Lines changed: 566 additions & 17 deletions

File tree

.github/scripts/build-all-images.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function get_image_tag() {
1010
}
1111

1212
function build_images() {
13+
oss_emulator_img=${IMG_REPO}/oss-emulator:e2e
1314
images=(
1415
${IMG_REPO}/dataset-controller:${IMAGE_TAG}
1516
${IMG_REPO}/application-controller:${IMAGE_TAG}
@@ -24,9 +25,11 @@ function build_images() {
2425
${IMG_REPO}/fluid-csi:${IMAGE_TAG}
2526
${IMG_REPO}/fluid-webhook:${IMAGE_TAG}
2627
${IMG_REPO}/fluid-crd-upgrader:${IMAGE_TAG}
28+
${oss_emulator_img}
2729
)
2830

2931
make docker-build-all
32+
docker build -t ${oss_emulator_img} test/gha-e2e/jindo/oss-emulator
3033

3134
for img in ${images[@]}; do
3235
echo "Loading image $img to kind cluster..."

test/gha-e2e/jindo/job.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ spec:
99
restartPolicy: Never
1010
containers:
1111
- name: busybox
12-
image: busybox
12+
image: registry-cn-hongkong.ack.aliyuncs.com/acs/smartdata:6.9.1-202509151826
13+
imagePullPolicy: IfNotPresent
1314
resources:
1415
limits:
1516
ephemeral-storage: "5Gi"

test/gha-e2e/jindo/minio.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: minio
5+
labels:
6+
app: minio
7+
app.kubernetes.io/part-of: jindo-e2e-minio
58
spec:
69
type: ClusterIP
710
clusterIP: None
@@ -11,31 +14,38 @@ spec:
1114
protocol: TCP
1215
selector:
1316
app: minio
17+
app.kubernetes.io/part-of: jindo-e2e-minio
1418
---
1519
apiVersion: apps/v1
1620
kind: Deployment
1721
metadata:
1822
# This name uniquely identifies the Deployment
1923
name: minio
24+
labels:
25+
app: minio
26+
app.kubernetes.io/part-of: jindo-e2e-minio
2027
spec:
2128
replicas: 1
2229
selector:
2330
matchLabels:
2431
app: minio
32+
app.kubernetes.io/part-of: jindo-e2e-minio
2533
strategy:
2634
type: Recreate
2735
template:
2836
metadata:
2937
labels:
3038
# Label is used as selector in the service.
3139
app: minio
40+
app.kubernetes.io/part-of: jindo-e2e-minio
3241
spec:
3342
hostname: mybucket
3443
subdomain: minio
3544
containers:
3645
- name: minio
3746
# Pulls the default Minio image from Docker Hub
3847
image: minio/minio
48+
imagePullPolicy: IfNotPresent
3949
resources:
4050
limits:
4151
memory: "512Mi"
@@ -57,5 +67,4 @@ spec:
5767
value: "minioadmin"
5868
ports:
5969
- containerPort: 9000
60-
hostPort: 9000
6170
automountServiceAccountToken: false
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: access-key-a
5+
namespace: default
6+
type: Opaque
7+
stringData:
8+
fs.oss.accessKeyId: __ACCESS_KEY_ID_A__
9+
fs.oss.accessKeySecret: __ACCESS_KEY_SECRET_A__
10+
---
11+
apiVersion: v1
12+
kind: Secret
13+
metadata:
14+
name: access-key-b
15+
namespace: default
16+
type: Opaque
17+
stringData:
18+
fs.oss.accessKeyId: __ACCESS_KEY_ID_B__
19+
fs.oss.accessKeySecret: __ACCESS_KEY_SECRET_B__
20+
---
21+
apiVersion: data.fluid.io/v1alpha1
22+
kind: Dataset
23+
metadata:
24+
name: jindo-multi-oss-demo
25+
spec:
26+
mounts:
27+
- mountPoint: oss://__BUCKET_A__/subpath/
28+
options:
29+
fs.oss.endpoint: "__ENDPOINT_A__"
30+
encryptOptions:
31+
- name: fs.oss.accessKeyId
32+
valueFrom:
33+
secretKeyRef:
34+
name: access-key-a
35+
key: fs.oss.accessKeyId
36+
- name: fs.oss.accessKeySecret
37+
valueFrom:
38+
secretKeyRef:
39+
name: access-key-a
40+
key: fs.oss.accessKeySecret
41+
name: bucket-a
42+
path: /bucket-a
43+
- mountPoint: oss://__BUCKET_B__/subpath/
44+
options:
45+
fs.oss.endpoint: "__ENDPOINT_B__"
46+
encryptOptions:
47+
- name: fs.oss.accessKeyId
48+
valueFrom:
49+
secretKeyRef:
50+
name: access-key-b
51+
key: fs.oss.accessKeyId
52+
- name: fs.oss.accessKeySecret
53+
valueFrom:
54+
secretKeyRef:
55+
name: access-key-b
56+
key: fs.oss.accessKeySecret
57+
name: bucket-b
58+
path: /bucket-b
59+
accessModes:
60+
- ReadOnlyMany
61+
---
62+
apiVersion: data.fluid.io/v1alpha1
63+
kind: JindoRuntime
64+
metadata:
65+
name: jindo-multi-oss-demo
66+
spec:
67+
jindoVersion:
68+
imagePullPolicy: IfNotPresent
69+
fuse:
70+
imagePullPolicy: IfNotPresent
71+
replicas: 1
72+
tieredstore:
73+
levels:
74+
- mediumtype: SSD
75+
path: /var/lib/docker/jindo
76+
quota: 1Gi
77+
high: "0.99"
78+
low: "0.95"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: batch/v1
2+
kind: Job
3+
metadata:
4+
name: fluid-multi-oss-test
5+
spec:
6+
backoffLimit: 1
7+
template:
8+
spec:
9+
restartPolicy: Never
10+
containers:
11+
- name: busybox
12+
image: registry-cn-hongkong.ack.aliyuncs.com/acs/smartdata:6.9.1-202509151826
13+
imagePullPolicy: IfNotPresent
14+
resources:
15+
limits:
16+
ephemeral-storage: "5Gi"
17+
command: ["/bin/sh"]
18+
args:
19+
- -c
20+
- |
21+
set -ex
22+
for i in $(seq 1 24); do
23+
if test "$(cat /data/bucket-a/testfile 2>/dev/null)" = "__EXPECTED_DATA_A__" && \
24+
test "$(cat /data/bucket-b/testfile 2>/dev/null)" = "__EXPECTED_DATA_B__"; then
25+
exit 0
26+
fi
27+
sleep 5
28+
done
29+
exit 1
30+
volumeMounts:
31+
- mountPath: /data
32+
name: fluid-vol
33+
automountServiceAccountToken: false
34+
volumes:
35+
- name: fluid-vol
36+
persistentVolumeClaim:
37+
claimName: jindo-multi-oss-demo
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: oss-a
5+
labels:
6+
app: oss-a
7+
app.kubernetes.io/part-of: jindo-e2e-oss
8+
spec:
9+
clusterIP: None
10+
ports:
11+
- port: 9000
12+
targetPort: 9000
13+
selector:
14+
app: oss-a
15+
app.kubernetes.io/part-of: jindo-e2e-oss
16+
---
17+
apiVersion: apps/v1
18+
kind: Deployment
19+
metadata:
20+
name: oss-a
21+
labels:
22+
app: oss-a
23+
app.kubernetes.io/part-of: jindo-e2e-oss
24+
spec:
25+
replicas: 1
26+
selector:
27+
matchLabels:
28+
app: oss-a
29+
app.kubernetes.io/part-of: jindo-e2e-oss
30+
template:
31+
metadata:
32+
labels:
33+
app: oss-a
34+
app.kubernetes.io/part-of: jindo-e2e-oss
35+
spec:
36+
hostname: bucket-a
37+
subdomain: oss-a
38+
containers:
39+
- name: emulator
40+
image: fluidcloudnative/oss-emulator:e2e
41+
imagePullPolicy: IfNotPresent
42+
env:
43+
- name: BUCKET_NAME
44+
value: bucket-a
45+
- name: OBJECT_KEY
46+
value: subpath/testfile
47+
- name: OBJECT_VALUE
48+
value: bucket-a-data
49+
ports:
50+
- containerPort: 9000
51+
automountServiceAccountToken: false
52+
---
53+
apiVersion: v1
54+
kind: Service
55+
metadata:
56+
name: oss-b
57+
labels:
58+
app: oss-b
59+
app.kubernetes.io/part-of: jindo-e2e-oss
60+
spec:
61+
clusterIP: None
62+
ports:
63+
- port: 9000
64+
targetPort: 9000
65+
selector:
66+
app: oss-b
67+
app.kubernetes.io/part-of: jindo-e2e-oss
68+
---
69+
apiVersion: apps/v1
70+
kind: Deployment
71+
metadata:
72+
name: oss-b
73+
labels:
74+
app: oss-b
75+
app.kubernetes.io/part-of: jindo-e2e-oss
76+
spec:
77+
replicas: 1
78+
selector:
79+
matchLabels:
80+
app: oss-b
81+
app.kubernetes.io/part-of: jindo-e2e-oss
82+
template:
83+
metadata:
84+
labels:
85+
app: oss-b
86+
app.kubernetes.io/part-of: jindo-e2e-oss
87+
spec:
88+
hostname: bucket-b
89+
subdomain: oss-b
90+
containers:
91+
- name: emulator
92+
image: fluidcloudnative/oss-emulator:e2e
93+
imagePullPolicy: IfNotPresent
94+
env:
95+
- name: BUCKET_NAME
96+
value: bucket-b
97+
- name: OBJECT_KEY
98+
value: subpath/testfile
99+
- name: OBJECT_VALUE
100+
value: bucket-b-data
101+
ports:
102+
- containerPort: 9000
103+
automountServiceAccountToken: false
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM golang:1.24.12-bookworm AS builder
2+
WORKDIR /src
3+
COPY main.go .
4+
RUN CGO_ENABLED=0 go build -o /oss-emulator main.go
5+
6+
FROM scratch
7+
COPY --from=builder /oss-emulator /oss-emulator
8+
EXPOSE 9000
9+
ENTRYPOINT ["/oss-emulator"]

0 commit comments

Comments
 (0)