Skip to content

Commit

Permalink
Onboard Infinibox CSI driver
Browse files Browse the repository at this point in the history
Reference - https://github.com/Infinidat/infinibox-csi-driver/tree/develop/deploy/examples
alongside some offline chats with recommendations.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
  • Loading branch information
akalenyu committed Jul 10, 2024
1 parent 86eb720 commit f1c0afd
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions pkg/storagecapabilities/storagecapabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ var CapabilitiesByProvisionerKey = map[string][]StorageCapabilities{
"manila.csi.openstack.org": {{rwx, file}},
// ovirt csi
"csi.ovirt.org": createRWOBlockAndFilesystemCapabilities(),
// Infinidat
"infinibox-csi-driver/iscsiorfibrechannel": {{rwx, block}, {rwo, block}, {rwo, file}},
"infinibox-csi-driver/nfs": {{rwx, file}, {rwo, file}},
}

// SourceFormatsByProvisionerKey defines the advised data import cron source format
Expand All @@ -118,25 +121,27 @@ var SourceFormatsByProvisionerKey = map[string]cdiv1.DataImportCronSourceFormat{

// CloneStrategyByProvisionerKey defines the advised clone strategy for a provisioner
var CloneStrategyByProvisionerKey = map[string]cdiv1.CDICloneStrategy{
"csi-vxflexos.dellemc.com": cdiv1.CloneStrategyCsiClone,
"csi-isilon.dellemc.com": cdiv1.CloneStrategyCsiClone,
"csi-powermax.dellemc.com": cdiv1.CloneStrategyCsiClone,
"csi-powerstore.dellemc.com": cdiv1.CloneStrategyCsiClone,
"hspc.csi.hitachi.com": cdiv1.CloneStrategyCsiClone,
"csi.hpe.com": cdiv1.CloneStrategyCsiClone,
"spectrumscale.csi.ibm.com": cdiv1.CloneStrategyCsiClone,
"rook-ceph.rbd.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"openshift-storage.rbd.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"cephfs.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"openshift-storage.cephfs.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"pxd.openstorage.org/shared": cdiv1.CloneStrategyCsiClone,
"pxd.openstorage.org": cdiv1.CloneStrategyCsiClone,
"pxd.portworx.com/shared": cdiv1.CloneStrategyCsiClone,
"pxd.portworx.com": cdiv1.CloneStrategyCsiClone,
"topolvm.cybozu.com": cdiv1.CloneStrategyHostAssisted,
"topolvm.io": cdiv1.CloneStrategyHostAssisted,
"csi.trident.netapp.io/ontap-nas": cdiv1.CloneStrategySnapshot,
"csi.trident.netapp.io/ontap-san": cdiv1.CloneStrategySnapshot,
"csi-vxflexos.dellemc.com": cdiv1.CloneStrategyCsiClone,
"csi-isilon.dellemc.com": cdiv1.CloneStrategyCsiClone,
"csi-powermax.dellemc.com": cdiv1.CloneStrategyCsiClone,
"csi-powerstore.dellemc.com": cdiv1.CloneStrategyCsiClone,
"hspc.csi.hitachi.com": cdiv1.CloneStrategyCsiClone,
"csi.hpe.com": cdiv1.CloneStrategyCsiClone,
"spectrumscale.csi.ibm.com": cdiv1.CloneStrategyCsiClone,
"rook-ceph.rbd.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"openshift-storage.rbd.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"cephfs.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"openshift-storage.cephfs.csi.ceph.com": cdiv1.CloneStrategyCsiClone,
"pxd.openstorage.org/shared": cdiv1.CloneStrategyCsiClone,
"pxd.openstorage.org": cdiv1.CloneStrategyCsiClone,
"pxd.portworx.com/shared": cdiv1.CloneStrategyCsiClone,
"pxd.portworx.com": cdiv1.CloneStrategyCsiClone,
"topolvm.cybozu.com": cdiv1.CloneStrategyHostAssisted,
"topolvm.io": cdiv1.CloneStrategyHostAssisted,
"infinibox-csi-driver/iscsiorfibrechannel": cdiv1.CloneStrategyCsiClone,
"infinibox-csi-driver/nfs": cdiv1.CloneStrategyCsiClone,
"csi.trident.netapp.io/ontap-nas": cdiv1.CloneStrategySnapshot,
"csi.trident.netapp.io/ontap-san": cdiv1.CloneStrategySnapshot,
}

const (
Expand Down Expand Up @@ -226,7 +231,7 @@ func storageProvisionerKey(sc *storagev1.StorageClass) string {

var storageClassToProvisionerKeyMapper = map[string]func(sc *storagev1.StorageClass) string{
"pxd.openstorage.org": func(sc *storagev1.StorageClass) string {
//https://docs.portworx.com/portworx-install-with-kubernetes/storage-operations/create-pvcs/create-shared-pvcs/
// https://docs.portworx.com/portworx-install-with-kubernetes/storage-operations/create-pvcs/create-shared-pvcs/
val := sc.Parameters["shared"]
if val == "true" {
return "pxd.openstorage.org/shared"
Expand All @@ -241,15 +246,15 @@ var storageClassToProvisionerKeyMapper = map[string]func(sc *storagev1.StorageCl
return "kubernetes.io/portworx-volume"
},
"pxd.portworx.com": func(sc *storagev1.StorageClass) string {
//https://docs.portworx.com/portworx-install-with-kubernetes/storage-operations/csi/volumelifecycle/#create-shared-csi-enabled-volumes
// https://docs.portworx.com/portworx-install-with-kubernetes/storage-operations/csi/volumelifecycle/#create-shared-csi-enabled-volumes
val := sc.Parameters["shared"]
if val == "true" {
return "pxd.portworx.com/shared"
}
return "pxd.portworx.com"
},
"csi.trident.netapp.io": func(sc *storagev1.StorageClass) string {
//https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/concepts/objects.html#kubernetes-storageclass-objects
// https://netapp-trident.readthedocs.io/en/stable-v20.04/kubernetes/concepts/objects.html#kubernetes-storageclass-objects
val := sc.Parameters["backendType"]
if strings.HasPrefix(val, "ontap-nas") {
return "csi.trident.netapp.io/ontap-nas"
Expand All @@ -259,6 +264,17 @@ var storageClassToProvisionerKeyMapper = map[string]func(sc *storagev1.StorageCl
}
return "UNKNOWN"
},
"infinibox-csi-driver": func(sc *storagev1.StorageClass) string {
// https://github.com/Infinidat/infinibox-csi-driver/tree/develop/deploy/examples
switch sc.Parameters["storage_protocol"] {
case "iscsi", "fc":
return "infinibox-csi-driver/iscsiorfibrechannel"
case "nfs", "nfs_treeq":
return "infinibox-csi-driver/nfs"
default:
return "UNKNOWN"
}
},
}

func createRbdCapabilities() []StorageCapabilities {
Expand Down

0 comments on commit f1c0afd

Please sign in to comment.