curve提供命令行管理工具curve,用来创建、删除卷等管理操作。具体接口如下:

    • 创建卷:
    • 删除卷:curve delete [-h] --user USER --filename FILENAME
    • 扩容卷:curve extend [-h] --user USER --filename FILENAME --length LENGTH
    • 查询卷:curve stat [-h] --user USER --filename FILENAME
    • rename卷:curve rename [-h] --user USER --filename FILENAME --newname NEWNAME
    • 创建目录:curve mkdir [-h] --user USER --dirname DIRNAME
    • 删除目录:curve rmdir [-h] --user USER --dirname DIRNAME
    • 查询目录下所有文件:curve list [-h] --user USER --dirname DIRNAME

    Implementing with Kubernetes CSI

    CSI spec:

    1. CreateVolume +------------+ DeleteVolume
    2. +------------->| CREATED +--------------+
    3. | Controller | | Controller v
    4. +++ Publish | | Unpublish +++
    5. |X| Volume | | Volume | |
    6. +-+ +---v----+---+ +-+
    7. | NODE_READY |
    8. Node | | Node
    9. Stage | | Unstage
    10. Volume | | Volume
    11. | VOL_READY |
    12. +---+----^---+
    13. Node | | Node
    14. Publish | | Unpublish
    15. Volume | | Volume
    16. +---v----+---+
    17. | PUBLISHED |
    18. +------------+
    • CreateVolume:
      • curve mkdir: DIRNAME在k8s storageClass定义
      • curve create: FILENAME为
      • curve stat: 等待卷ready
    • Controller Publish Volume:
    • Node Stage Volume:
      • curve-nbd list-mapped: 查看是否已经被挂载
      • curve-nbd map: 挂载
    • Node Publish Volume:
      • mount the stagePath to the publishPath
    • Node Unpublish Volume:
      • umount publishPath
    • Node Unstage Volume:
      • curve-nbd list-mapped: 查看是否已经被卸载
      • curve-nbd unmap: 卸载
    • Controller Unpublish Volume:
      • Nothing to do
    • DeleteVolume:
      • curve delete

    其他可选支持:

      • ControllerExpandVolume: curve extend
      • NodeExpandVolume: resize2fs/xfs_growfs