应用场景
CSI(以1.5.0版本为例)对接两个HBlock,集群版和单机版。
clusterID为stor1,对应集群版。clusterID为stor2,对应单机版。
集群版的服务器IP和API为:192.168.0.64:1443、192.168.0.65:1443、192.168.0.67:1443。单机版的服务器IP和API端口为192.168.0.66:1443。
集群版的用户名和密码为:storuser、hblock12@。单机版的用户名和密码为:storuser、hblock12@。userKey源码可以参考配置HBlock访问用户名和密码示例中的步骤1、2。
集群版和单机版均不使用CHAP认证,如若使用,可以参考配置加密模式 。
启用样例blockVolumes的动态PV样例(dynamicPv),验证HBlock CSI是否已经可以正常启用。
操作步骤
修改配置文件,并应用配置文件
修改charts/csi-driver-stor/values.yaml配置文件,配置HBlock访问地址、访问用户名和密码、加密模式。
images: csiProvisioner: registry.aliyuncs.com/google_containers/csi-provisioner:v3.5.0 csiAttacher: registry.aliyuncs.com/google_containers/csi-attacher:v4.3.0 csiResizer: registry.aliyuncs.com/google_containers/csi-resizer:v1.8.0 csiDriverRegistrar: registry.aliyuncs.com/google_containers/csi-node-driver-registrar:v2.8.0 csiSnapshotter: registry.aliyuncs.com/google_containers/csi-snapshotter:v6.3.0 csiSnapshotController: registry.aliyuncs.com/google_containers/snapshot-controller:v6.3.0 csiStorPlugin: stor-csi-driver:1.5.0 storConfig: configJson: |- [ { "clusterID": "stor1", "apiEndPointList": [ "https://192.168.0.64:1443", "https://192.168.0.65:1443", "https://192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "https://192.168.0.66:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 } ] userKey: WwogICAgICB7CiAgICAgICAgImNsdXN0ZXJJRCI6ICJzdG9yMSIsICAKICAgICAgICAidXNlcm5hbWUiOiAic3RvcnVzZXIiLAogICAgICAgICJwYXNzd29yZCI6ICJoYmxvY2sxMkAiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAiY2x1c3RlcklEIjogInN0b3IyIiwgIAogICAgICAgICJ1c2VybmFtZSI6ICJzdG9ydXNlciIsCiAgICAgICAgInBhc3N3b3JkIjogImhibG9jazEyQCIKICAgICAgfQogICAgXQo= chap: # Whether to enable chap encryption. true(dHJ1ZQ==), false(ZmFsc2U=) decryptFlag: ZmFsc2U= # Encrypt the key with base64 decryptData: c3RvcjAxMjM0NTY3ODkwMQ== # Samples of pod, pvc and storageclass example: # Mode of block blockVolumes: # Sample of dynamic pv. Path is templates/examples/block-volumes/dynamic-pv dynamicPv: enable: false clusterId: cluster1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of statefulset with dynamic pv. Path is templates/examples/block-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/block-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun05 # Mode of filesystem filesystemVolumes: dynamicPv: # Sample of dynamic pv. Path is templates/examples/filesystem-volumes/dynamic-pv/local local: enable: false clusterId: cluster1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of dynamic pv with chap disabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap localChap: enable: false clusterId: cluster1 clusterMode: true chapUser: user chapPassword: skskdndD0dkfL # Sample of dynamic pv with chap enabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap-encrypt localChapDecrypt: enable: false clusterId: cluster1 clusterMode: true chapUser: SFFFzADcpZaUJKsYbPq54A== chapPassword: tbHWrBep3R0RhkFaW+f5Fw== # Sample of statefulset with dynamic pv. Path is templates/examples/filesystem-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/filesystem-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun04 snapshots: # Sample of static snapshot. # snapshot should pre-provisioned before staticSnapshot be enabled. # Path is templates/examples/snapshots/static-snapshot staticSnapshot: enable: false clusterId: cluster1 sourceLunName: lu1 snapshotName: s1
应用配置文件,在charts/csi-driver-stor下执行更新配置命令。
[root@k8s-master csi-driver-stor]# helm upgrade stor ./ Release "stor" has been upgraded. Happy Helming! NAME: stor LAST DEPLOYED: Sun Apr 27 11:20:59 2025 NAMESPACE: default STATUS: deployed REVISION: 2 TEST SUITE: None NOTES: The Stor CSI Plugin has been published. The plugin image is: stor-csi-driver:1.5.0 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "https://192.168.0.64:1443", "https://192.168.0.65:1443", "https://192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "https://192.168.0.66:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 } ]
使用样例验证HBlock配置是否成功(可选)
说明
此处HBlock CSI中配置了2个HBlock,则需要验证2个HBlock的样例。
验证clusterID为stor1的HBlock(集群版)
启用样例。
(1) 修改配置文件charts/csi-driver-stor/values.yaml中example的开关,打开样例blockVolumes中的动态PV样例、快照和克隆开关,clusterID为stor1,clusterMode为true。images: csiProvisioner: registry.aliyuncs.com/google_containers/csi-provisioner:v3.5.0 csiAttacher: registry.aliyuncs.com/google_containers/csi-attacher:v4.3.0 csiResizer: registry.aliyuncs.com/google_containers/csi-resizer:v1.8.0 csiDriverRegistrar: registry.aliyuncs.com/google_containers/csi-node-driver-registrar:v2.8.0 csiSnapshotter: registry.aliyuncs.com/google_containers/csi-snapshotter:v6.3.0 csiSnapshotController: registry.aliyuncs.com/google_containers/snapshot-controller:v6.3.0 csiStorPlugin: stor-csi-driver:1.5.0 …… # Samples of pod, pvc and storageclass example: # Mode of block blockVolumes: # Sample of dynamic pv. Path is templates/examples/block-volumes/dynamic-pv dynamicPv: enable: true clusterId: stor1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: true # Sample of clone pv using snapshot. clonePv: enable: true # Sample of clone pv using dynamic pv. clonePv: enable: true # Sample of statefulset with dynamic pv. Path is templates/examples/block-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/block-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun05 # Mode of filesystem filesystemVolumes: dynamicPv: # Sample of dynamic pv. Path is templates/examples/filesystem-volumes/dynamic-pv/local local: enable: false clusterId: cluster1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of dynamic pv with chap disabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap localChap: enable: false clusterId: cluster1 clusterMode: true chapUser: user chapPassword: skskdndD0dkfL # Sample of dynamic pv with chap enabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap-encrypt localChapDecrypt: enable: false clusterId: cluster1 clusterMode: true chapUser: SFFFzADcpZaUJKsYbPq54A== chapPassword: tbHWrBep3R0RhkFaW+f5Fw== # Sample of statefulset with dynamic pv. Path is templates/examples/filesystem-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/filesystem-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun04 snapshots: # Sample of static snapshot. # snapshot should pre-provisioned before staticSnapshot be enabled. # Path is templates/examples/snapshots/static-snapshot staticSnapshot: enable: false clusterId: cluster1 sourceLunName: lu1 snapshotName: s1
(2) 应用配置文件,在charts/csi-driver-stor下执行更新配置命令。
[root@k8s-master csi-driver-stor]# helm upgrade stor ./ Release "stor" has been upgraded. Happy Helming! NAME: stor LAST DEPLOYED: Sun Apr 27 11:38:43 2025 NAMESPACE: default STATUS: deployed REVISION: 3 TEST SUITE: None NOTES: The Stor CSI Plugin has been published. The plugin image is: stor-csi-driver:1.5.0 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "https://192.168.0.64:1443", "https://192.168.0.65:1443", "https://192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "https://192.168.0.66:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 } ]
(3) 验证HBlock CSI是否已经可以正常启用:如果启用的样例成功建立pod,则表示HBlock CSI可以正常启用。如果快照和克隆卷创建成功,说明快照和克隆功能正常。
[root@k8s-master csi-driver-stor]# kubectl get pod NAME READY STATUS RESTARTS AGE csi-storplugin-controller-79df7bf49c-wr4tb 4/4 Running 0 62m csi-storplugin-node-4lzr9 2/2 Running 0 62m csi-storplugin-node-jx95c 2/2 Running 0 62m my-csi-app-block-dynamic 1/1 Running 0 18m snapshot-controller-0 1/1 Running 0 62m [root@k8s-master csi-driver-stor]# kubectl get volumesnapshots NAME READYTOUSE SOURCEPVC SOURCESNAPSHOTCONTENT RESTORESIZE SNAPSHOTCLASS SNAPSHOTCONTENT CREATIONTIME AGE csi-dynamic-snapshot-block true csi-pvc-local-block 1 csi-dynamic-snapclass-block snapcontent-53f92ad6-faa9-47c7-850a-d7304a4b1594 3m35s 3m41s [root@k8s-master csi-driver-stor]# kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE clone-pvc-from-pvc-block Bound pvc-34e4f98f-4a87-4a38-9a4d-633940160c09 1Gi RWO csi-stor-sc-local-dynamic-block 6m25s clone-pvc-from-snapshot-block Bound pvc-37f0324c-2836-4979-8b4e-858c3ce3df54 1Gi RWO csi-stor-sc-local-dynamic-block 6m25s csi-pvc-local-block Bound pvc-47fef833-791d-4a3b-b93b-c94f198c9d3b 1Gi RWO csi-stor-sc-local-dynamic-block 6m25s
停用刚启动的样例:如果启用了样例,为了避免与正式的实例冲突,建议停用样例。
(1)在values.yaml中,将dynamicPv的样例、快照和克隆开关设置为false。
images: csiProvisioner: registry.aliyuncs.com/google_containers/csi-provisioner:v3.5.0 csiAttacher: registry.aliyuncs.com/google_containers/csi-attacher:v4.3.0 csiResizer: registry.aliyuncs.com/google_containers/csi-resizer:v1.8.0 csiDriverRegistrar: registry.aliyuncs.com/google_containers/csi-node-driver-registrar:v2.8.0 csiSnapshotter: registry.aliyuncs.com/google_containers/csi-snapshotter:v6.3.0 csiSnapshotController: registry.aliyuncs.com/google_containers/snapshot-controller:v6.3.0 csiStorPlugin: stor-csi-driver:1.5.0 …… # Samples of pod, pvc and storageclass example: # Mode of block blockVolumes: # Sample of dynamic pv. Path is templates/examples/block-volumes/dynamic-pv dynamicPv: enable: false clusterId: stor1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of statefulset with dynamic pv. Path is templates/examples/block-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/block-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun05 # Mode of filesystem filesystemVolumes: dynamicPv: # Sample of dynamic pv. Path is templates/examples/filesystem-volumes/dynamic-pv/local local: enable: false clusterId: cluster1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of dynamic pv with chap disabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap localChap: enable: false clusterId: cluster1 clusterMode: true chapUser: user chapPassword: skskdndD0dkfL # Sample of dynamic pv with chap enabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap-encrypt localChapDecrypt: enable: false clusterId: cluster1 clusterMode: true chapUser: SFFFzADcpZaUJKsYbPq54A== chapPassword: tbHWrBep3R0RhkFaW+f5Fw== # Sample of statefulset with dynamic pv. Path is templates/examples/filesystem-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/filesystem-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun04 snapshots: # Sample of static snapshot. # snapshot should pre-provisioned before staticSnapshot be enabled. # Path is templates/examples/snapshots/static-snapshot staticSnapshot: enable: false clusterId: cluster1 sourceLunName: lu1 snapshotName: s1
(2)执行命令helm upgrade stor ./更新配置。
[root@k8s-master csi-driver-stor]# helm upgrade stor ./ Release "stor" has been upgraded. Happy Helming! NAME: stor LAST DEPLOYED: Sun Apr 27 13:54:58 2025 NAMESPACE: default STATUS: deployed REVISION: 8 TEST SUITE: None NOTES: The Stor CSI Plugin has been published. The plugin image is: stor-csi-driver:1.5.0 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "https://192.168.0.64:1443", "https://192.168.0.65:1443", "https://192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "https://192.168.0.66:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 } ]
(3)执行命令kubectl get pod检查样例是否停用,若刚创建的POD、快照和PVC都不存在,即说明样例已停用。
[root@k8s-master csi-driver-stor]# kubectl get pod NAME READY STATUS RESTARTS AGE csi-storplugin-controller-79df7bf49c-wr4tb 4/4 Running 0 3h19m csi-storplugin-node-4lzr9 2/2 Running 0 3h19m csi-storplugin-node-jx95c 2/2 Running 0 3h19m snapshot-controller-0 1/1 Running 0 3h19m [root@k8s-master csi-driver-stor]# kubectl get volumesnapshots No resources found in default namespace. [root@k8s-master csi-driver-stor]# kubectl get pvc No resources found in default namespace.
验证clusterID为stor2的HBlock(单机版)
启用样例。
(1)修改配置文件charts/csi-driver-stor/values.yaml中example的开关,打开样例blockVolumes中的动态PV样例、快照和克隆开关,将clusterMode的取值修改为false,clusterId为stor2images: csiProvisioner: registry.aliyuncs.com/google_containers/csi-provisioner:v3.5.0 csiAttacher: registry.aliyuncs.com/google_containers/csi-attacher:v4.3.0 csiResizer: registry.aliyuncs.com/google_containers/csi-resizer:v1.8.0 csiDriverRegistrar: registry.aliyuncs.com/google_containers/csi-node-driver-registrar:v2.8.0 csiSnapshotter: registry.aliyuncs.com/google_containers/csi-snapshotter:v6.3.0 csiSnapshotController: registry.aliyuncs.com/google_containers/snapshot-controller:v6.3.0 csiStorPlugin: stor-csi-driver:1.5.0 …… # Samples of pod, pvc and storageclass example: # Mode of block blockVolumes: # Sample of dynamic pv. Path is templates/examples/block-volumes/dynamic-pv dynamicPv: enable: true clusterId: stor2 clusterMode: false # Sample of snapshot using dynamic pv. snapshot: enable: true # Sample of clone pv using snapshot. clonePv: enable: true # Sample of clone pv using dynamic pv. clonePv: enable: true # Sample of statefulset with dynamic pv. Path is templates/examples/block-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/block-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun05 # Mode of filesystem filesystemVolumes: dynamicPv: # Sample of dynamic pv. Path is templates/examples/filesystem-volumes/dynamic-pv/local local: enable: false clusterId: cluster1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of dynamic pv with chap disabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap localChap: enable: false clusterId: cluster1 clusterMode: true chapUser: user chapPassword: skskdndD0dkfL # Sample of dynamic pv with chap enabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap-encrypt localChapDecrypt: enable: false clusterId: cluster1 clusterMode: true chapUser: SFFFzADcpZaUJKsYbPq54A== chapPassword: tbHWrBep3R0RhkFaW+f5Fw== # Sample of statefulset with dynamic pv. Path is templates/examples/filesystem-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/filesystem-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun04 snapshots: # Sample of static snapshot. # snapshot should pre-provisioned before staticSnapshot be enabled. # Path is templates/examples/snapshots/static-snapshot staticSnapshot: enable: false clusterId: cluster1 sourceLunName: lu1 snapshotName: s1
(2)应用配置文件,在charts/csi-driver-stor下执行更新配置命令。
[root@k8s-master csi-driver-stor]# helm upgrade stor ./ Release "stor" has been upgraded. Happy Helming! NAME: stor LAST DEPLOYED: Sun Apr 27 14:07:14 2025 NAMESPACE: default STATUS: deployed REVISION: 9 TEST SUITE: None NOTES: The Stor CSI Plugin has been published. The plugin image is: stor-csi-driver:1.5.0 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "https://192.168.0.64:1443", "https://192.168.0.65:1443", "https://192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "https://192.168.0.66:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 } ]
(3)验证HBlock CSI是否已经可以正常启用:如果启用的样例成功建立pod,则表示HBlock CSI可以正常启用。如果快照和克隆卷创建成功,说明快照和克隆功能正常。
[root@k8s-master csi-driver-stor]# kubectl get pod NAME READY STATUS RESTARTS AGE csi-storplugin-controller-79df7bf49c-wr4tb 4/4 Running 0 3h31m csi-storplugin-node-4lzr9 2/2 Running 0 3h31m csi-storplugin-node-jx95c 2/2 Running 0 3h31m my-csi-app-block-dynamic 1/1 Running 0 38s snapshot-controller-0 1/1 Running 0 3h31m [root@k8s-master csi-driver-stor]# kubectl get volumesnapshots NAME READYTOUSE SOURCEPVC SOURCESNAPSHOTCONTENT RESTORESIZE SNAPSHOTCLASS SNAPSHOTCONTENT CREATIONTIME AGE csi-dynamic-snapshot-block true csi-pvc-local-block 1 csi-dynamic-snapclass-block snapcontent-eadd468b-0024-4378-8957-8c4da77bb94d 48s 52s [root@k8s-master csi-driver-stor]# kubectl get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE clone-pvc-from-pvc-block Bound pvc-a5979ae5-ddda-4c48-b0c7-077c838645fe 1Gi RWO csi-stor-sc-local-dynamic-block 66s clone-pvc-from-snapshot-block Bound pvc-91b8c7f7-cd75-4028-a616-547b415f2a8e 1Gi RWO csi-stor-sc-local-dynamic-block 66s csi-pvc-local-block Bound pvc-d8676b60-a20f-4cbf-8fd3-d97e7a9fc32d 1Gi RWO csi-stor-sc-local-dynamic-block 66s
停用刚启动的样例:如果启用了样例,为了避免与正式的实例冲突,建议停用样例。
(1)在values.yaml中,将blockVolumes中的动态PV样例、快照和克隆开关设置位false。
images: csiProvisioner: registry.aliyuncs.com/google_containers/csi-provisioner:v3.5.0 csiAttacher: registry.aliyuncs.com/google_containers/csi-attacher:v4.3.0 csiResizer: registry.aliyuncs.com/google_containers/csi-resizer:v1.8.0 csiDriverRegistrar: registry.aliyuncs.com/google_containers/csi-node-driver-registrar:v2.8.0 csiSnapshotter: registry.aliyuncs.com/google_containers/csi-snapshotter:v6.3.0 csiSnapshotController: registry.aliyuncs.com/google_containers/snapshot-controller:v6.3.0 csiStorPlugin: stor-csi-driver:1.5.0 …… # Samples of pod, pvc and storageclass example: # Mode of block blockVolumes: # Sample of dynamic pv. Path is templates/examples/block-volumes/dynamic-pv dynamicPv: enable: false clusterId: stor2 clusterMode: false # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of statefulset with dynamic pv. Path is templates/examples/block-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/block-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun05 # Mode of filesystem filesystemVolumes: dynamicPv: # Sample of dynamic pv. Path is templates/examples/filesystem-volumes/dynamic-pv/local local: enable: false clusterId: cluster1 clusterMode: true # Sample of snapshot using dynamic pv. snapshot: enable: false # Sample of clone pv using snapshot. clonePv: enable: false # Sample of clone pv using dynamic pv. clonePv: enable: false # Sample of dynamic pv with chap disabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap localChap: enable: false clusterId: cluster1 clusterMode: true chapUser: user chapPassword: skskdndD0dkfL # Sample of dynamic pv with chap enabled. Path is templates/examples/filesystem-volumes/dynamic-pv/local-chap-encrypt localChapDecrypt: enable: false clusterId: cluster1 clusterMode: true chapUser: SFFFzADcpZaUJKsYbPq54A== chapPassword: tbHWrBep3R0RhkFaW+f5Fw== # Sample of statefulset with dynamic pv. Path is templates/examples/filesystem-volumes/statefulset statefulset: enable: false clusterId: cluster1 clusterMode: true # Sample of static pv. Path is templates/examples/filesystem-volumes/static-pv staticPv: enable: false clusterId: cluster1 clusterMode: true lunName: lun04 snapshots: # Sample of static snapshot. # snapshot should pre-provisioned before staticSnapshot be enabled. # Path is templates/examples/snapshots/static-snapshot staticSnapshot: enable: false clusterId: cluster1 sourceLunName: lu1 snapshotName: s1
(2)执行命令helm upgrade stor ./更新配置。
[root@k8s-master csi-driver-stor]# helm upgrade stor ./ Release "stor" has been upgraded. Happy Helming! NAME: stor LAST DEPLOYED: Sun Apr 27 14:13:27 2025 NAMESPACE: default STATUS: deployed REVISION: 10 TEST SUITE: None NOTES: The Stor CSI Plugin has been published. The plugin image is: stor-csi-driver:1.5.0 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "https://192.168.0.64:1443", "https://192.168.0.65:1443", "https://192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "https://192.168.0.66:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 } ]
(3)执行命令kubectl get pod检查样例是否停用,若刚创建的POD、快照和PVC都不存在,即说明样例已停用。
[root@k8s-master csi-driver-stor]# kubectl get pod NAME READY STATUS RESTARTS AGE csi-storplugin-controller-79df7bf49c-wr4tb 4/4 Running 0 3h37m csi-storplugin-node-4lzr9 2/2 Running 0 3h37m csi-storplugin-node-jx95c 2/2 Running 0 3h37m snapshot-controller-0 1/1 Running 0 3h37m [root@k8s-master csi-driver-stor]# kubectl get volumesnapshots No resources found in default namespace. [root@k8s-master csi-driver-stor]# kubectl get pvc No resources found in default namespace.