注意
若Kubernetes集群中部署了多套HBlock CSI,需在各自對應的安裝路徑下,配置HBlock訪問地址。多套HBlock CSI可以對接同一HBlock。
HBlock CSI插件通過調用HBlock 的HTTP RESTful API進行存儲卷的管理操作,例如創建卷、刪除卷、擴容卷等。需要配置插件訪問HBlock RESTful API的URL地址和端口。
說明
支持對接多個HBlock,包括:HBlock單機版本、HBlock集群版。
可以按照下列步驟配置HBlock訪問地址。
修改配置文件
修改deploy/csi-plugin-conf/csi-configMap.yaml配置文件,apiEndPointList配置為HBlock HTTP RESTful API地址和端口,storProvider配置為HBlock。apiVersion: v1 kind: ConfigMap metadata: name: csi-plugin-stor namespace: @DRIVER_NAMESPACE@ data: config.json: |- [ { "clusterID": "cluster1", "apiEndPointList": [ "//xx.xx.xx.xx:xx", "//xx.xx.xx.xx:xx", "//xx.xx.xx.xx:xx" ], "storProvider": "HBlock", "csiApiTimeout": csiApiTimeout }, { "clusterID": "cluster2", "apiEndPointList": [ "//xx.xx.xx.xx:xx" ], "storProvider": "HBlock", "csiApiTimeout": csiApiTimeout }, { "clusterID": "cluster3", "apiEndPointList": [ "//xx.xx.xx.xx:xx", "//xx.xx.xx.xx:xx", "//xx.xx.xx.xx:xx" ], "storProvider": "HBlock", "csiApiTimeout": csiApiTimeout } ]參數
參數
描述 是否必填 metadata.name ConfigMap資源的資源名稱。
取值csi-plugin-stor,不可更改。
是 metadata.namespace 綁定的Kubernetes命名空間。
取值:
如果已經安裝 HBlock CSI,命名空間已確定,直接將該字段值修改為對應命名空間值。完成csi-configMap.yaml文件的修改、保存并應用后,相關配置即可自動生效。
如果還未安裝HBlock CSI,此字段取值保持為@DRIVER_NAMESPACE@,執行deploy安裝腳本時,即可自動替換為對應的命名空間。
是 clusterID 指定HBlock的標識,在csi-configMap中唯一。
取值:字符串形式,長度范圍是1~256,可以包含字母、數字、和短橫線(-),字母區分大小寫。
是 storProvider HBlock產品名稱。
取值:HBlock。
是 apiEndPointList HBlock的服務器IP地址及API端口號;或者已經關聯了HBlock IP和API端口號的Kubernetes service域名。 是 csiApiTimeout 指定HBlock創建LUN的等待時間,在等待時間內LUN創建失敗,會報錯,然后重試。
取值:正整數,默認值為480,單位是秒。
注意
建議使用默認值。
否 示例:對接集群版HBlock和單機版HBlock。
apiVersion: v1 kind: ConfigMap metadata: name: csi-plugin-stor namespace: default data: config.json: |- [ { "clusterID": "stor1", "apiEndPointList": [ "//192.168.0.192:1443", "//192.168.0.110:1443", "//192.168.0.102:1443" ], "storProvider": "HBlock", "csiApiTimeout": 480 }, { "clusterID": "stor2", "apiEndPointList": [ "//192.168.0.32:1443" ], "storProvider": "HBlock" } ]應用配置文件。
[root@server csi-plugin-conf]# kubectl apply -f csi-configMap.yaml configmap/csi-plugin-stor configured