應用場景
CSI(以1.5.1版本為例)對接兩個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訪問地址、訪問用戶名和密碼、加密模式。
driverName: stor.csi.k8s.io driverNamespace: default iscsiOnHost: 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.1 storConfig: configJson: |- [ { "clusterID": "stor1", "apiEndPointList": [ "//192.168.0.64:1443", "//192.168.0.65:1443", "//192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "//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.1 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "//192.168.0.64:1443", "//192.168.0.65:1443", "//192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "//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.1 …… # 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.1 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "//192.168.0.64:1443", "//192.168.0.65:1443", "//192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "//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 volumesnapshot 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.1 …… # 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.1 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "//192.168.0.64:1443", "//192.168.0.65:1443", "//192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "//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 volumesnapshot 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.1 …… # 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.1 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "//192.168.0.64:1443", "//192.168.0.65:1443", "//192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "//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 volumesnapshot 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.1 …… # 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.1 The Stor Cluster Info is: [ { "clusterID": "stor1", "apiEndPointList": [ "//192.168.0.64:1443", "//192.168.0.65:1443", "//192.168.0.67:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "//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 volumesnapshot No resources found in default namespace. [root@k8s-master csi-driver-stor]# kubectl get pvc No resources found in default namespace.