This page looks best with JavaScript enabled

Using Fluid to Access S3 Storage and Performance Testing

1. Jindo Mounting S3

  • Set the environment variables
1
2
3
4
export ENDPOINT=obs.ap-southeast-3.myhuaweicloud.com
export BUCKET=
export AK=
export SK=
  • Create the credentials
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
  name: mys3secret
type: Opaque
stringData:
  fs.s3.accessKeyId: ${AK}
  fs.s3.accessKeySecret: ${SK}
EOF
  • Create the Dataset
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: Dataset
metadata:
  name: mys3-jindo
spec:
  mounts:
    - mountPoint: s3://${BUCKET}/test2/
      options:
        fs.s3.endpoint: ${ENDPOINT}
      encryptOptions:
        - name: fs.s3.accessKeyId
          valueFrom:
            secretKeyRef:
              name: mys3secret
              key: fs.s3.accessKeyId
        - name: fs.s3.accessKeySecret
          valueFrom:
            secretKeyRef:
              name: mys3secret
              key: fs.s3.accessKeySecret
  accessModes:
    - ReadWriteMany
EOF
  • Create the JindoRuntime
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
kubectl apply -f - <<EOF
apiVersion: data.fluid.io/v1alpha1
kind: JindoRuntime
metadata:
  name: mys3-jindo
spec:
  replicas: 2
  tieredstore:
    levels:
      - mediumtype: SSD
        path: /cache
        quota: 40960
EOF
  • Create the Pod workload
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: mys3-jindo
spec:
  containers:
    - name: demo
      image: shaowenchen/demo:ubuntu
      volumeMounts:
        - mountPath: /data
          name: data
  volumes:
    - name: data
      persistentVolumeClaim:
        claimName: mys3-jindo
EOF

2. Performance Testing

Enter the Pod

1
kubectl exec -it mys3-jindo -- bash

Run

1
curl -sSL https://d.juicefs.com/install | sh -

Install the JuiceFS client

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
juicefs bench --block-size 4 --big-file-size 1024  /data

Benchmark finished!
BlockSize: 4.0 MiB, BigFileSize: 1.0 GiB, SmallFileSize: 128 KiB, SmallFileCount: 100, NumThreads: 1
+------------------+--------------+----------------+
|       ITEM       |     VALUE    |      COST      |
+------------------+--------------+----------------+
|   Write big file | 394.04 MiB/s |    2.60 s/file |
|    Read big file | 304.28 MiB/s |    3.37 s/file |
| Write small file |  7.0 files/s | 143.11 ms/file |
|  Read small file | 18.2 files/s |  55.07 ms/file |
|        Stat file | 41.5 files/s |  24.09 ms/file |
+------------------+--------------+----------------+

3. Cleaning Up Resources

1
2
3
kubectl delete secret mys3secret
kubectl delete dataset mys3-jindo
kubectl delete jindoruntime mys3-jindo

WeChat Official Account
WRITTEN BY
WeChat Official Account