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:
CreateVolume +------------+ DeleteVolume
+------------->| CREATED +--------------+
| Controller | | Controller v
+++ Publish | | Unpublish +++
|X| Volume | | Volume | |
+-+ +---v----+---+ +-+
| NODE_READY |
Node | | Node
Stage | | Unstage
Volume | | Volume
| VOL_READY |
+---+----^---+
Node | | Node
Publish | | Unpublish
Volume | | Volume
+---v----+---+
| PUBLISHED |
+------------+
- CreateVolume:
- curve mkdir: DIRNAME在
k8s storageClass
定义 - curve create: FILENAME为
- curve stat: 等待卷ready
- curve mkdir: DIRNAME在
- 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