To deploy GooseFS using TKE, the open source Fluid component is required, which is available in the TKE application market. You can deploy as follows:
1. Use Fluid helm chart to deploy controllers.
2. Use kubectl to create the dataset and GooseFS runtime.
Considerations
1. Have a Tencent Cloud TKE cluster.
2. Have installed kubectl of v1.18 or a later version.
Installation
1. Navigate to the TKE Application Market, locate the Fluid application, and click to access the application details.
2. Click Create Application, enter a name, select the TKE cluster in the side panel, and in the parameter input box, change the
true parameter to false (do not install Alluxio). Keep other configurations as default. Then click Create.3. Verify the controller components. In the left Cluster, locate the corresponding cluster. If you see two controllers in the cluster's workloads, it indicates that the Fluid component has been installed successfully.
Operation Example
1. Cluster access authorization
[root@master01 run]# export KUBECONFIG=xxx/cls-xxx-config (Download the cluster credential to a directory from the TKE console.)
Note
The cluster API Server needs to have external network access enabled.
2. Create a UFS dataset (using COS as an example)
First, create a secret.yaml file for encryption. The template is as follows:
apiVersion: v1kind: Secretmetadata:name: mysecretstringData:fs.cosn.userinfo.secretKey: xxxfs.cosn.userinfo.secretId: xxx
Create
secret:[root@master01 ~]# kubectl apply -f secret.yamlsecret/mysecret created
dataset.yaml template:apiVersion: data.fluid.io/v1alpha1kind: Datasetmetadata:name: slice1spec:mounts:- mountPoint: cosn://{your bucket}name: slice1options:fs.cosn.bucket.region: ap-beijingfs.cosn.impl: org.apache.hadoop.fs.CosFileSystemfs.AbstractFileSystem.cosn.impl: org.apache.hadoop.fs.CosNfs.cosn.userinfo.appid: "${your appid}"encryptOptions:- name: fs.cosn.userinfo.secretKeyvalueFrom:secretKeyRef:name: mysecretkey: fs.cosn.userinfo.secretKey- name: fs.cosn.userinfo.secretIdvalueFrom:secretKeyRef:name: mysecretkey: fs.cosn.userinfo.secretId
Create a dataset:
[root@master01 run]# kubectl apply -f dataset.yamldataset.data.fluid.io/slice1 created
Query the dataset status (NotBond):
[root@master01 run]# kubectl get datasetNAME UFS TOTAL SIZE CACHED CACHE CAPACITY CACHED PERCENTAGE PHASE AGEslice1NotBound 11s
3. Creating the runtime
untime.yaml template:apiVersion: data.fluid.io/v1alpha1kind: GooseFSRuntimemetadata:name: slice1spec:replicas: 1data:replicas: 1goosefsVersion:imagePullPolicy: Alwaysimage: ${img_uri}imageTag: ${tag}tieredstore:levels:- mediumtype: MEMpath: /dev/shmquota: 1Gihigh: "0.95"low: "0.7"properties:# goosefs usergoosefs.user.file.writetype.default: MUST_CACHEmaster:replicas: 1journal:volumeType: hostpathjvmOptions:- "-Xmx40G"- "-XX:+UnlockExperimentalVMOptions"- "-XX:ActiveProcessorCount=8"worker:jvmOptions:- "-Xmx12G"- "-XX:+UnlockExperimentalVMOptions"- "-XX:MaxDirectMemorySize=32g"- "-XX:ActiveProcessorCount=8"resources:limits:cpu: 8fuse:imagePullPolicy: Alwaysimage: ${fuse_uri}imageTag: ${tag_num}env:MAX_IDLE_THREADS: "32"jvmOptions:- "-Xmx16G"- "-Xms16G"- "-XX:+UseG1GC"- "-XX:MaxDirectMemorySize=32g"- "-XX:+UnlockExperimentalVMOptions"- "-XX:ActiveProcessorCount=24"resources:limits:cpu: 16args:- fuse- --fuse-opts=kernel_cache,ro,max_read=131072,attr_timeout=7200,entry_timeout=7200,nonempty
Create runtime:
[root@master01 run]# kubectl apply -f runtime.yamlgoosefsruntime.data.fluid.io/slice1 created
Check the GooseFS component status:
[root@master01 run]# kubectl get podsNAME READY STATUS RESTARTS AGEslice1-fuse-xsvwj 1/1 Running 0 37sslice1-master-0 2/2 Running 0 118sslice1-worker-fzpdw 2/2 Running 0 37s
4. Load Data
dataload.yaml data loading component:apiVersion: data.fluid.io/v1alpha1kind: DataLoadmetadata:name: slice1-dataloadspec:dataset:name: slice1namespace: default
The dataset status is “Bond”, and 0% is cached.
[root@master01 run]# kubectl get datasetNAME UFS TOTAL SIZE CACHED CACHE CAPACITY CACHED PERCENTAGE PHASE AGEslice1 97.67MiB 0.00B 4.00GiB 0.0% Bound 31m
Start loading data:
[root@master01 run]# kubectl apply -f dataload.yamldataload.data.fluid.io/slice1-dataload created
View data loading progress:
[root@master01 run]# kubectl get dataset --watchNAME UFS TOTAL SIZE CACHED CACHE CAPACITY CACHED PERCENTAGE PHASE AGEslice1 97.67MiB 52.86MiB 4.00GiB 54.1% Bound 39mslice1 97.67MiB 53.36MiB 4.00GiB 54.6% Bound 39mslice1 97.67MiB 53.36MiB 4.00GiB 54.6% Bound 39mslice1 97.67MiB 53.87MiB 4.00GiB 55.2% Bound 39mslice1 97.67MiB 53.87MiB 4.00GiB 55.2% Bound 39m
100% of the data is cached:
[root@master01 run]# kubectl get dataset --watchNAME UFS TOTAL SIZE CACHED CACHE CAPACITY CACHED PERCENTAGE PHASE AGEslice1 97.67MiB 97.67MiB 4.00GiB 100.0% Bound 44m
5. Inspect Data
[root@master01 run]# kubectl get podsNAME READY STATUS RESTARTS AGEslice1-dataload-loader-job-km6mg 0/1 Completed 0 12mslice1-fuse-xsvwj 1/1 Running 0 17mslice1-master-0 2/2 Running 0 19mslice1-worker-fzpdw 2/2 Running 0 17m
Go to the GooseFS master container:
[root@master01 run]# kubectl exec -it slice1-master-0 -- /bin/bashDefaulting container name to goosefs-master.
List GooseFS directories:
[root@VM-2-40-tlinux goosefs-1.0.0-SNAPSHOT-noUI-noHelm]# goosefs fs ls /slice110240 PERSISTED 06-25-2021 16:45:11:809 100% /slice1/p11 PERSISTED 05-24-2021 16:07:37:000 DIR /slice1/a10000 PERSISTED 05-26-2021 19:29:05:000 DIR /slice1/p2
View a specific file:
[root@VM-2-40-tlinux goosefs-1.0.0-SNAPSHOT-noUI-noHelm]# goosefs fs ls /slice1/a/12 PERSISTED 06-25-2021 16:45:11:809 100% /slice1/a/1.xt