Documentation ¶
Index ¶
- Constants
- func KubernetesVolumeIDToEBSVolumeID(kubernetesID string) (string, error)
- func TopologyKeyExist(key string, vna *v1.VolumeNodeAffinity) bool
- type InTreePlugin
- func NewAWSElasticBlockStoreCSITranslator() InTreePlugin
- func NewAzureDiskCSITranslator() InTreePlugin
- func NewAzureFileCSITranslator() InTreePlugin
- func NewGCEPersistentDiskCSITranslator() InTreePlugin
- func NewOpenStackCinderCSITranslator() InTreePlugin
- func NewPortworxCSITranslator() InTreePlugin
- func NewvSphereCSITranslator() InTreePlugin
Constants ¶
const ( // AWSEBSDriverName is the name of the CSI driver for EBS AWSEBSDriverName = "ebs.csi.aws.com" // AWSEBSInTreePluginName is the name of the intree plugin for EBS AWSEBSInTreePluginName = "kubernetes.io/aws-ebs" // AWSEBSTopologyKey is the zonal topology key for AWS EBS CSI driver AWSEBSTopologyKey = "topology." + AWSEBSDriverName + "/zone" )
const ( // AzureDiskDriverName is the name of the CSI driver for Azure Disk AzureDiskDriverName = "disk.csi.azure.com" // AzureDiskTopologyKey is the topology key of Azure Disk CSI driver AzureDiskTopologyKey = "topology.disk.csi.azure.com/zone" // AzureDiskInTreePluginName is the name of the intree plugin for Azure Disk AzureDiskInTreePluginName = "kubernetes.io/azure-disk" )
const ( // AzureFileDriverName is the name of the CSI driver for Azure File AzureFileDriverName = "file.csi.azure.com" // AzureFileInTreePluginName is the name of the intree plugin for Azure file AzureFileInTreePluginName = "kubernetes.io/azure-file" )
const ( // GCEPDDriverName is the name of the CSI driver for GCE PD GCEPDDriverName = "pd.csi.storage.gke.io" // GCEPDInTreePluginName is the name of the intree plugin for GCE PD GCEPDInTreePluginName = "kubernetes.io/gce-pd" // GCEPDTopologyKey is the zonal topology key for GCE PD CSI Driver GCEPDTopologyKey = "topology.gke.io/zone" // UnspecifiedValue is used for an unknown zone string UnspecifiedValue = "UNSPECIFIED" )
const ( // CinderDriverName is the name of the CSI driver for Cinder CinderDriverName = "cinder.csi.openstack.org" // CinderTopologyKey is the zonal topology key for Cinder CSI Driver CinderTopologyKey = "topology.cinder.csi.openstack.org/zone" // CinderInTreePluginName is the name of the intree plugin for Cinder CinderInTreePluginName = "kubernetes.io/cinder" )
const ( PortworxVolumePluginName = "kubernetes.io/portworx-volume" PortworxDriverName = "pxd.portworx.com" )
const ( // VSphereDriverName is the name of the CSI driver for vSphere Volume VSphereDriverName = "csi.vsphere.vmware.com" // VSphereInTreePluginName is the name of the in-tree plugin for vSphere Volume VSphereInTreePluginName = "kubernetes.io/vsphere-volume" // AttributeInitialVolumeFilepath represents the path of volume where volume is created AttributeInitialVolumeFilepath = "initialvolumefilepath" )
Variables ¶
This section is empty.
Functions ¶
func KubernetesVolumeIDToEBSVolumeID ¶
KubernetesVolumeIDToEBSVolumeID translates Kubernetes volume ID to EBS volume ID KubernetesVolumeID forms:
- aws://<zone>/<awsVolumeId>
- aws:///<awsVolumeId>
- <awsVolumeId>
EBS Volume ID form:
- vol-<alphanumberic>
This translation shouldn't be needed and should be fixed in long run See https://github.com/kubernetes/kubernetes/issues/73730
func TopologyKeyExist ¶ added in v0.21.0
func TopologyKeyExist(key string, vna *v1.VolumeNodeAffinity) bool
TopologyKeyExist checks if a certain key exists in a VolumeNodeAffinity
Types ¶
type InTreePlugin ¶
type InTreePlugin interface { // TranslateInTreeStorageClassToCSI takes in-tree volume options // and translates them to a volume options consumable by CSI plugin TranslateInTreeStorageClassToCSI(logger klog.Logger, sc *storage.StorageClass) (*storage.StorageClass, error) // TranslateInTreeInlineVolumeToCSI takes a inline volume and will translate // the in-tree inline volume source to a CSIPersistentVolumeSource // A PV object containing the CSIPersistentVolumeSource in it's spec is returned // podNamespace is only needed for azurefile to fetch secret namespace, no need to be set for other plugins. TranslateInTreeInlineVolumeToCSI(logger klog.Logger, volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) // TranslateInTreePVToCSI takes a persistent volume and will translate // the in-tree pv source to a CSI Source. The input persistent volume can be modified TranslateInTreePVToCSI(logger klog.Logger, pv *v1.PersistentVolume) (*v1.PersistentVolume, error) // TranslateCSIPVToInTree takes a PV with a CSI PersistentVolume Source and will translate // it to a in-tree Persistent Volume Source for the in-tree volume // by the `Driver` field in the CSI Source. The input PV object can be modified TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) // CanSupport tests whether the plugin supports a given persistent volume // specification from the API. CanSupport(pv *v1.PersistentVolume) bool // CanSupportInline tests whether the plugin supports a given inline volume // specification from the API. CanSupportInline(vol *v1.Volume) bool // GetInTreePluginName returns the in-tree plugin name this migrates GetInTreePluginName() string // GetCSIPluginName returns the name of the CSI plugin that supersedes the in-tree plugin GetCSIPluginName() string // RepairVolumeHandle generates a correct volume handle based on node ID information. RepairVolumeHandle(volumeHandle, nodeID string) (string, error) }
InTreePlugin handles translations between CSI and in-tree sources in a PV
func NewAWSElasticBlockStoreCSITranslator ¶
func NewAWSElasticBlockStoreCSITranslator() InTreePlugin
NewAWSElasticBlockStoreCSITranslator returns a new instance of awsElasticBlockStoreTranslator
func NewAzureDiskCSITranslator ¶
func NewAzureDiskCSITranslator() InTreePlugin
NewAzureDiskCSITranslator returns a new instance of azureDiskTranslator
func NewAzureFileCSITranslator ¶
func NewAzureFileCSITranslator() InTreePlugin
NewAzureFileCSITranslator returns a new instance of azureFileTranslator
func NewGCEPersistentDiskCSITranslator ¶
func NewGCEPersistentDiskCSITranslator() InTreePlugin
NewGCEPersistentDiskCSITranslator returns a new instance of gcePersistentDiskTranslator
func NewOpenStackCinderCSITranslator ¶
func NewOpenStackCinderCSITranslator() InTreePlugin
NewOpenStackCinderCSITranslator returns a new instance of osCinderCSITranslator
func NewPortworxCSITranslator ¶ added in v0.23.0
func NewPortworxCSITranslator() InTreePlugin
func NewvSphereCSITranslator ¶ added in v0.19.0
func NewvSphereCSITranslator() InTreePlugin
NewvSphereCSITranslator returns a new instance of vSphereCSITranslator