Skip to content

Conversation

@linfangrong
Copy link

@linfangrong linfangrong commented Nov 14, 2025

在原基础上,增加clientpod挂载方式。

CSI挂载逻辑如下:
NodeStageVolume,进行stagingPath挂载。
NodePublishVolume,进行mount bind操作。

主要在NodeStageVolume上实现:

  1. 开关参数:csi.client-pod/enabled,取值 true(Pod 挂载)/ false(直接挂载,默认)
  2. csi.client-pod/image 单独进行podimage的配置, 进行cfs-client的镜像升级。由于cubefs-csi镜像携带了客户端、fuse。可以直接使用。
  3. provisioner 开启 --extra-create-metadata, 注入PVC信息(pvcname,pvcnamespace)。 通过pvcname生成pod spec,进行stagingPath挂载。 一个pvcname生成一个pod。
  4. 历史volumecontext携带了cfs-client配置参数、卷创建参数。 本次需要增加pod配置信息, 所以进行了逻辑上的拆分。
    后续客户端这块可以单独抽离成一个模块,或者复用cubefs的sdk模块。
    TODO: 3.5.0以上增加的客户端配置参数, 需要额外增加哈...
  5. Client Pod Spec 可以再梳理下, 增加 NodeSelector, 亲和性配置等...

ClientPod Spec

  • OwnerReferences 强绑定:ClientPod 的 OwnerReference 直接指向 PVC,设置 Controller: true 和 BlockOwnerDeletion: true,确保 PVC 删除时 Pod 被级联删除。
  • NodeSelector: 延用CSI node Pod的NodeSelector。
  • NodeAffinity: 延用CSI node Pod的NodeAffinity。
  • Tolerations: 延用CSI node Pod的Tolerations。

@linfangrong linfangrong marked this pull request as ready for review November 14, 2025 04:02
DefaultLogDir = "/cfs/logs"
CfsClientBin = "/cfs/bin/cfs-client"

CfsConfArg = "-c" // 配置文件参数标识
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use english comment if possible

@Huweicai
Copy link
Member

可以在描述里面大概介绍一下你的实现方式吗

@linfangrong
Copy link
Author

可以在描述里面大概介绍一下你的实现方式吗

好的!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants