Documentation ¶
Index ¶
- func GetSnapshotType(snap *snapv1.VolumeSnapshot) string
- func IsNodeMatch(k8sNode *v1.Node, driverNode *NodeInfo) bool
- func Register(name string, d Driver) error
- type ClusterPairNotSupported
- type ClusterPairPluginInterface
- type Driver
- type ErrPVCPending
- type Info
- type MigratePluginInterface
- type MigrationNotSupported
- func (m *MigrationNotSupported) CancelMigration(*stork_crd.Migration) error
- func (m *MigrationNotSupported) GetMigrationStatus(*stork_crd.Migration) ([]*stork_crd.VolumeInfo, error)
- func (m *MigrationNotSupported) StartMigration(*stork_crd.Migration) ([]*stork_crd.VolumeInfo, error)
- func (m *MigrationNotSupported) UpdateMigratedPersistentVolumeSpec(runtime.Unstructured) (runtime.Unstructured, error)
- type NodeInfo
- type NodeStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSnapshotType ¶
func GetSnapshotType(snap *snapv1.VolumeSnapshot) string
GetSnapshotType gets the snapshot type
func IsNodeMatch ¶ added in v1.1.4
IsNodeMatch There are a couple of things that need to be checked to see if the driver node matched the k8s node since different k8s installs set the node name, hostname and IPs differently
Types ¶
type ClusterPairNotSupported ¶
type ClusterPairNotSupported struct{}
ClusterPairNotSupported to be used by drivers that don't support pairing
func (*ClusterPairNotSupported) CreatePair ¶
func (c *ClusterPairNotSupported) CreatePair(*stork_crd.ClusterPair) (string, error)
CreatePair Returns ErrNotSupported
func (*ClusterPairNotSupported) DeletePair ¶
func (c *ClusterPairNotSupported) DeletePair(*stork_crd.ClusterPair) error
DeletePair Returns ErrNotSupported
type ClusterPairPluginInterface ¶
type ClusterPairPluginInterface interface { // Create a pair with a remote cluster CreatePair(*stork_crd.ClusterPair) (string, error) // Deletes a paring with a remote cluster DeletePair(*stork_crd.ClusterPair) error }
ClusterPairPluginInterface Interface to pair clusters
type Driver ¶
type Driver interface { // Init initializes the volume driver. Init(interface{}) error // String returns the string name of this driver. String() string // InspectVolume returns information about a volume. InspectVolume(volumeID string) (*Info, error) // GetNodes Get the list of nodes where the driver is available GetNodes() ([]*NodeInfo, error) // GetPodVolumes Get all the volumes used by a pod backed by the driver GetPodVolumes(*v1.PodSpec, string) ([]*Info, error) // GetVolumeClaimTemplates Get all the volume templates from the list backed by // the driver GetVolumeClaimTemplates([]v1.PersistentVolumeClaim) ([]v1.PersistentVolumeClaim, error) // OwnsPVC returns true if the PVC is owned by the driver OwnsPVC(pvc *v1.PersistentVolumeClaim) bool // GetSnapshotPlugin Get the snapshot plugin to be used for the driver GetSnapshotPlugin() snapshotVolume.Plugin // GetSnapshotType Get the type of the snapshot. Return error is snapshot // doesn't belong to driver GetSnapshotType(snap *snapv1.VolumeSnapshot) (string, error) // Stop the driver Stop() error // ClusterPairPluginInterface Interface to pair clusters ClusterPairPluginInterface // MigratePluginInterface Interface to migrate data between clusters MigratePluginInterface }
Driver defines an external volume driver interface. Any driver that wants to be used with stork needs to implement these interfaces.
type ErrPVCPending ¶
type ErrPVCPending struct { // Name of the PVC Name string }
ErrPVCPending PVC hasn't been bound yet
func (*ErrPVCPending) Error ¶
func (e *ErrPVCPending) Error() string
type Info ¶
type Info struct { // VolumeID is a unique identifier for the volume VolumeID string // VolumeName is the name for the volume VolumeName string // DataNodes is a list of nodes where the data for the volume resides DataNodes []string // Size is the size of the volume in GB Size uint64 // ParentID points to the ID of the parent volume for snapshots ParentID string // Labels are user applied labels on the volume Labels map[string]string // VolumeSourceRef is a optional reference to the source of the volume VolumeSourceRef interface{} }
Info Information about a volume
type MigratePluginInterface ¶
type MigratePluginInterface interface { // Start migration of volumes specified by the spec. Should only migrate // volumes, not the specs associated with them StartMigration(*stork_crd.Migration) ([]*stork_crd.VolumeInfo, error) // Get the status of migration of the volumes specified in the status // for the migration spec GetMigrationStatus(*stork_crd.Migration) ([]*stork_crd.VolumeInfo, error) // Cancel the migration of volumes specified in the status CancelMigration(*stork_crd.Migration) error // Update the PVC spec to point to the migrated volume on the destination // cluster UpdateMigratedPersistentVolumeSpec(object runtime.Unstructured) (runtime.Unstructured, error) }
MigratePluginInterface Interface to migrate data between clusters
type MigrationNotSupported ¶
type MigrationNotSupported struct{}
MigrationNotSupported to be used by drivers that don't support migration
func (*MigrationNotSupported) CancelMigration ¶
func (m *MigrationNotSupported) CancelMigration(*stork_crd.Migration) error
CancelMigration returns ErrNotSupported
func (*MigrationNotSupported) GetMigrationStatus ¶
func (m *MigrationNotSupported) GetMigrationStatus(*stork_crd.Migration) ([]*stork_crd.VolumeInfo, error)
GetMigrationStatus returns ErrNotSupported
func (*MigrationNotSupported) StartMigration ¶
func (m *MigrationNotSupported) StartMigration(*stork_crd.Migration) ([]*stork_crd.VolumeInfo, error)
StartMigration returns ErrNotSupported
func (*MigrationNotSupported) UpdateMigratedPersistentVolumeSpec ¶
func (m *MigrationNotSupported) UpdateMigratedPersistentVolumeSpec( runtime.Unstructured, ) (runtime.Unstructured, error)
UpdateMigratedPersistentVolumeSpec returns ErrNotSupported
type NodeInfo ¶
type NodeInfo struct { // ID is a unique identifier for the node ID string // Hostname of the node. Should be in lower case because Kubernetes // converts it to lower case Hostname string // IPs List of IPs associated with the node IPs []string // Rack Specifies the rack within the datacenter where the node is located Rack string // Zone Specifies the zone where the rack is located Zone string // Region Specifies the region where the datacenter is located Region string // Status of the node Status NodeStatus }
NodeInfo Information about a node
type NodeStatus ¶
type NodeStatus string
NodeStatus Status of driver on a node
const ( // NodeOnline Node is online NodeOnline NodeStatus = "Online" // NodeOffline Node is Offline NodeOffline NodeStatus = "Offline" // NodeDegraded Node is in degraded state NodeDegraded NodeStatus = "Degraded" )