Comments (2)
我来做这个特性吧
from cubefs-csi.
挂载卷
总体思路:当有挂载请求过来时,CSI 控制进程在当前节点中生成一个 client pod,用户可以在 pvc 的 yaml 中定义一下这个 client pod 的资源(cpu/memory)。用户每挂载一个 pvc 则生成一个 client pod,如果挂载同一个 pvc 则不会额外再生成一个 client pod,在同一个节点上同一个 pvc 只会有一个 client pod,这样可以达到节约资源的目的。
具体过程如下:
CSI 接到 stage 请求后,查看 pvc 对应的 client pod 是否已经生成;
如果 client pod 已经生成,则直接返回;
如果 client pod 没有生成,则进行创建一个 client pod,镜像信息从 csi controller 上获取,pod 的资源限制信息从 pvc 上获取,如果没有则默认最大1c1g,然后返回;
CSI 接收 publish 请求,查看当前节点对应的 cm 配置中是否已经有此 publish 路径记录;
如果没有 publish 记录,则在 cm 配置中添加上此 pvc 的 publish 记录,接着往下走;
如果已经有 publish 记录,则直接检查 publish 对应的挂载点是否已经是个 mountpoint,如果是,则返回 ok;如果还不是 mountpoint 则返回 busycode,等待下一次 publish 请求的到来;
client pod 生成后,内部会有一个协程间隔获取(1s 一次)当前节点的 cm 记录,与自身的挂载信息进行比对,如果有变动则会进行挂载或者卸载。
当 CSI 挂载控制进程在 cm 配置上添加一条记录后,client pod 通过 cm 对比有所感知,则会将 client 挂载到对应的位置上。
这样整个挂载过程就完成了。
卸载卷
总体思路:当有卸载卷请求过来时,CSI 控制进程会在 cm 上将对应的记录进行删除,client pod 如果发现相关记录已经删除,则将相关挂载点进行卸载,当 CSI 收到 unstage 请求时,则将 client pod 进行删除。
具体过程如下:
CSI 接收到 unpublish 请求后,查看 cm 对应的配置是否已经删除,如果没有删除,则进行删除,如果已经删除,则查看相关挂载路径是否是个 mountpoint,如果不是则返回成功;如果是个 mountpoint 则返回 busycode,等待下一次 unpublish 请求过来。
CSI 接收到 unstage 请求,一般 unstage 请求是所有挂载点都已经清理完毕,k8s 认为当前 pvc 已经没有挂载点了,可以进行最后的清理了。所以这个请求到来后,可以直接将 client pod 进行删除。
因为 client pod 里面会有 cm 挂载记录对比机制,所以它可以根据这个进行卸载相关的挂载点。
from cubefs-csi.
Related Issues (20)
- Rename project name from ChubaoFS to CubeFS
- csi-attacher: Failed to list *v1beta1.VolumeAttachment HOT 6
- docker pull unknown blob HOT 2
- Failed to read from conn, req(ReqID(7)Op(OpMetaReadDirLimit)PartitionID(228)ResultCode(Unknown ResultCode(0))) HOT 6
- is there a plan to support kubernetes 1.22+ HOT 3
- Add feature that supports importing existing CubeFS volume into k8s cluster and create a corresponding PersistentVolume HOT 5
- create pvc need to support two type: replicas and EC
- create pvc success but vol is not exist
- bug: csi would mount the local disk to pod
- The vulnerability CVE-2023-30512 has been fixed, but no specific tag denotes the patched version.
- K8S CSI can not run on kunpeng arm 920 platform
- CubeFS CSI UT Completion
- EC(erasure code) Support
- Arm64 Support HOT 1
- batch create pvc vol failed HOT 1
- CubeFS 3.3.2 CSI image build
- update CSI build script
- Cannot use Auth with CubeFSI CSI yet HOT 1
- could you update this plugin a little bit, it not working on the latest k8s HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cubefs-csi.