Dataset 资源对象中所定义的远程文件是可被调度的,这意味着您能够像管理您的 Pod 一样管理远程文件缓存在 Kubernetes 集群上的存放位置。而执行计算的 Pod 可以通过 Fuse 客户端访问数据文件。$ kubectl get pod -n fluid-systemgoosefsruntime-controller-5b64fdbbb-84pc6 1/1 Running 0 8hcsi-nodeplugin-fluid-fwgjh 2/2 Running 0 8hcsi-nodeplugin-fluid-ll8bq 2/2 Running 0 8hdataset-controller-5b7848dbbb-n44dj 1/1 Running 0 8h
dataset-controller 的 Pod、一个名为 goosefsruntime-controller 的 Pod 和多个名为 csi-nodeplugin 的 Pod 正在运行。其中 csi-nodeplugin 这些 Pod 的数量取决于您的 Kubernetes 集群中结点的数量。$ mkdir <any-path>/fuse-global-deployment$ cd <any-path>/fuse-global-deployment
$ kubectl get nodesNAME STATUS ROLES AGE VERSION192.168.1.146 Ready <none> 7d14h v1.18.4-tke.13192.168.1.147 Ready <none> 7d14h v1.18.4-tke.13
$ kubectl label nodes 192.168.1.146 cache-node=true
NodeSelector 来管理集群中存放数据的位置,所以在这里标记期望的结点。$ kubectl get node -L cache-nodeNAME STATUS ROLES AGE VERSION cache-node192.168.1.146 Ready <none> 7d14h v1.18.4-tke.13 true192.168.1.147 Ready <none> 7d14h v1.18.4-tke.13
cache-node=true的标签,接下来,我们希望数据缓存仅会被放置在该结点之上。apiVersion: data.fluid.io/v1alpha1kind: Datasetmetadata:name: hbasespec:mounts:- mountPoint: https://mirrors.tuna.tsinghua.edu.cn/apache/hbase/stable/name: hbasenodeAffinity:required:nodeSelectorTerms:- matchExpressions:- key: cache-nodeoperator: Invalues:- "true"
Dataset 资源对象的 spec 属性中,我们定义了一个 nodeSelectorTerm 的子属性,该子属性要求数据缓存必须被放置在具有 cache-node=true 标签的结点之上。$ kubectl create -f dataset.yamldataset.data.fluid.io/hbase created
apiVersion: data.fluid.io/v1alpha1kind: GooseFSRuntimemetadata:name: hbasespec:replicas: 1tieredstore:levels:- mediumtype: SSDpath: /mnt/disk1/quota: 2Ghigh: "0.8"low: "0.7"fuse:global: true
spec.replicas 属性被设置为1,这表明 Fluid 将会启动一个包含1个 GooseFS Master 和1个 GooseFS Worker 的 GooseFS 实例。 另外一个值得注意的是 Fuse 包含global: true,这样意味着 Fuse 可以全局部署,而不依赖于数据缓存的位置。$ kubectl create -f runtime.yamlgoosefsruntime.data.fluid.io/hbase created$ kubectl get po -owideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATEShbase-fuse-gfq7z 1/1 Running 0 3m47s 192.168.1.147 192.168.1.147 <none> <none>hbase-fuse-lmk5p 1/1 Running 0 3m47s 192.168.1.146 192.168.1.146 <none> <none>hbase-master-0 2/2 Running 0 3m47s 192.168.1.147 192.168.1.147 <none> <none>hbase-worker-hvbp2 2/2 Running 0 3m1s 192.168.1.146 192.168.1.146 <none> <none>
cache-node=true )的节点之上。GooseFS Fuse 的数量为2,运行在所有的子节点上。$ kubectl get goosefsruntime hbase -o wideNAME READY MASTERS DESIRED MASTERS MASTER PHASE READY WORKERS DESIRED WORKERS WORKER PHASE READY FUSES DESIRED FUSES FUSE PHASE AGEhbase 1 1 Ready 1 1 Ready 2 2 Ready 12m
kubectl delete goosefsruntime hbase
apiVersion: data.fluid.io/v1alpha1kind: GooseFSRuntimemetadata:name: hbasespec:replicas: 1tieredstore:levels:- mediumtype: SSDpath: /mnt/disk1/quota: 2Ghigh: "0.8"low: "0.7"fuse:global: truenodeSelector:kubernetes.io/hostname: 192.168.1.147
global: true的前提下, 还增加了 nodeSelector 并且指向了节点192.168.1.147。$ kubectl create -f runtime-node-selector.yamlgoosefsruntime.data.fluid.io/hbase created$ kubectl get po -owideNAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATEShbase-fuse-xzbww 1/1 Running 0 1h 192.168.1.147 192.168.1.147 <none> <none>hbase-master-0 2/2 Running 0 1h 192.168.1.147 192.168.1.147 <none> <none>hbase-worker-vdxd5 2/2 Running 0 1h 192.168.1.146 192.168.1.146 <none> <none>
cache-node=true )的结点之上。GooseFS Fuse 的数量为1,运行在节点192.168.1.147上。$ kubectl get goosefsruntimes.data.fluid.io -owideNAME READY MASTERS DESIRED MASTERS MASTER PHASE READY WORKERS DESIRED WORKERS WORKER PHASE READY FUSES DESIRED FUSES FUSE PHASE AGEhbase 1 1 Ready 1 1 Ready 1 1 Ready 1h
$ kubectl delete -f .$ kubectl label node 192.168.1.146 cache-node-
文档反馈