mounts. To ensure security, Fluid provides the capability to configure these key information using Secret.apiVersion: v1kind: Secretmetadata:name: mysecretstringData:fs.cosn.userinfo.secretId: <COS_SECRET_ID>fs.cosn.userinfo.secretKey: <COS_SECRET_KEY>
fs.cosn.userinfo.secretKey and fs.cosn.userinfo.secretId are written in the Secret, and the dataset needs to read the corresponding values by looking for the same Secret and key. Key information is no longer directly written in the dataset, and thus the security of some data is guaranteed.$ kubectl apply -f secret.yamlsecret/mysecret created$ kubectl get secretNAME TYPE DATA AGEmysecret Opaque 2 57s
apiVersion: data.fluid.io/v1alpha1kind: Datasetmetadata:name: mydataspec:mounts:- mountPoint: cosn://<COS_BUCKET>/<COS_DIRECTORY>/name: mydataoptions:fs.cosn.bucket.region: <COS_REGION>fs.cosn.impl: org.apache.hadoop.fs.CosFileSystemfs.AbstractFileSystem.cosn.impl: org.apache.hadoop.fs.CosNfs.cosn.userinfo.appid: <COS_APP_ID>encryptOptions:- name: fs.cosn.userinfo.secretIdvalueFrom:secretKeyRef:name: mysecretkey: fs.cosn.userinfo.secretId- name: fs.cosn.userinfo.secretKeyvalueFrom:secretKeyRef:name: mysecretkey: fs.cosn.userinfo.secretKey---apiVersion: data.fluid.io/v1alpha1kind: GooseFSRuntimemetadata:name: mydataspec:replicas: 1tieredstore:levels:- mediumtype: SSDpath: /mnt/disk1/quota: 2Ghigh: "0.8"low: "0.7"
fs.cos.endpoint, we changed the configuration of fs.cosn.userinfo.secretId and fs.cosn.userinfo.secretKey to read from Secret to ensure security.options and encryptOptions, the value in encryptOptions will override the corresponding value in options.$ kubectl create -f dataset.yamldataset.data.fluid.io/mydata createdgoosefsruntime.data.fluid.io/mydata created
Ready, GooseFSRuntime is deployed successfully.$ kubectl get goosefsruntime mydataNAME MASTER PHASE WORKER PHASE FUSE PHASE AGEmydata Ready Ready Ready 62m
Bound, the dataset is bound successfully.$ kubectl get dataset mydataNAME UFS TOTAL SIZE CACHED CACHE CAPACITY CACHED PERCENTAGE PHASE AGEmydata 210.00MiB 0.00B 2GiB 0.0% Bound 1h
masukan