Documentation ¶
Index ¶
- func GetSnapshotType(snap *snapv1.VolumeSnapshot) string
- func IsNodeMatch(k8sNode *v1.Node, driverNode *NodeInfo) bool
- func Register(name string, d Driver) error
- type BackupRestoreNotSupported
- func (b *BackupRestoreNotSupported) CancelBackup(*stork_crd.ApplicationBackup) error
- func (b *BackupRestoreNotSupported) CancelRestore(*stork_crd.ApplicationRestore) error
- func (b *BackupRestoreNotSupported) DeleteBackup(*stork_crd.ApplicationBackup) error
- func (b *BackupRestoreNotSupported) GetBackupStatus(*stork_crd.ApplicationBackup) ([]*stork_crd.ApplicationBackupVolumeInfo, error)
- func (b *BackupRestoreNotSupported) GetRestoreStatus(*stork_crd.ApplicationRestore) ([]*stork_crd.ApplicationRestoreVolumeInfo, error)
- func (b *BackupRestoreNotSupported) StartBackup(*stork_crd.ApplicationBackup) ([]*stork_crd.ApplicationBackupVolumeInfo, error)
- func (b *BackupRestoreNotSupported) StartRestore(*stork_crd.ApplicationRestore) ([]*stork_crd.ApplicationRestoreVolumeInfo, error)
- type BackupRestorePluginInterface
- type CloneNotSupported
- type ClonePluginInterface
- type ClusterDomainsNotSupported
- type ClusterDomainsPluginInterface
- type ClusterPairNotSupported
- type ClusterPairPluginInterface
- type Driver
- type ErrPVCPending
- type GroupSnapshotCreateResponse
- type GroupSnapshotNotSupported
- func (g *GroupSnapshotNotSupported) CreateGroupSnapshot(*stork_crd.GroupVolumeSnapshot) (*GroupSnapshotCreateResponse, error)
- func (g *GroupSnapshotNotSupported) DeleteGroupSnapshot(*stork_crd.GroupVolumeSnapshot) error
- func (g *GroupSnapshotNotSupported) GetGroupSnapshotStatus(*stork_crd.GroupVolumeSnapshot) (*GroupSnapshotCreateResponse, error)
- type GroupSnapshotPluginInterface
- type Info
- type MigratePluginInterface
- type MigrationNotSupported
- func (m *MigrationNotSupported) CancelMigration(*stork_crd.Migration) error
- func (m *MigrationNotSupported) GetMigrationStatus(*stork_crd.Migration) ([]*stork_crd.MigrationVolumeInfo, error)
- func (m *MigrationNotSupported) StartMigration(*stork_crd.Migration) ([]*stork_crd.MigrationVolumeInfo, error)
- func (m *MigrationNotSupported) UpdateMigratedPersistentVolumeSpec(runtime.Unstructured) (runtime.Unstructured, error)
- type NodeInfo
- type NodeStatus
- type SnapshotRestorePluginInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSnapshotType ¶ added in v1.4.0
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 BackupRestoreNotSupported ¶ added in v1.4.0
type BackupRestoreNotSupported struct{}
BackupRestoreNotSupported to be used by drivers that don't support backup
func (*BackupRestoreNotSupported) CancelBackup ¶ added in v1.4.0
func (b *BackupRestoreNotSupported) CancelBackup(*stork_crd.ApplicationBackup) error
CancelBackup returns ErrNotSupported
func (*BackupRestoreNotSupported) CancelRestore ¶ added in v1.4.0
func (b *BackupRestoreNotSupported) CancelRestore(*stork_crd.ApplicationRestore) error
CancelRestore returns ErrNotSupported
func (*BackupRestoreNotSupported) DeleteBackup ¶ added in v1.4.0
func (b *BackupRestoreNotSupported) DeleteBackup(*stork_crd.ApplicationBackup) error
DeleteBackup returns ErrNotSupported
func (*BackupRestoreNotSupported) GetBackupStatus ¶ added in v1.4.0
func (b *BackupRestoreNotSupported) GetBackupStatus(*stork_crd.ApplicationBackup) ([]*stork_crd.ApplicationBackupVolumeInfo, error)
GetBackupStatus returns ErrNotSupported
func (*BackupRestoreNotSupported) GetRestoreStatus ¶ added in v1.4.0
func (b *BackupRestoreNotSupported) GetRestoreStatus(*stork_crd.ApplicationRestore) ([]*stork_crd.ApplicationRestoreVolumeInfo, error)
GetRestoreStatus returns ErrNotSupported
func (*BackupRestoreNotSupported) StartBackup ¶ added in v1.4.0
func (b *BackupRestoreNotSupported) StartBackup(*stork_crd.ApplicationBackup) ([]*stork_crd.ApplicationBackupVolumeInfo, error)
StartBackup returns ErrNotSupported
func (*BackupRestoreNotSupported) StartRestore ¶ added in v1.4.0
func (b *BackupRestoreNotSupported) StartRestore(*stork_crd.ApplicationRestore) ([]*stork_crd.ApplicationRestoreVolumeInfo, error)
StartRestore returns ErrNotSupported
type BackupRestorePluginInterface ¶ added in v1.4.0
type BackupRestorePluginInterface interface { // Start backup of volumes specified by the spec. Should only backup // volumes, not the specs associated with them StartBackup(*stork_crd.ApplicationBackup) ([]*stork_crd.ApplicationBackupVolumeInfo, error) // Get the status of backup of the volumes specified in the status // for the backup spec GetBackupStatus(*stork_crd.ApplicationBackup) ([]*stork_crd.ApplicationBackupVolumeInfo, error) // Cancel the backup of volumes specified in the status CancelBackup(*stork_crd.ApplicationBackup) error // Delete the backups specified in the status DeleteBackup(*stork_crd.ApplicationBackup) error // Start restore of volumes specified by the spec. Should only restore // volumes, not the specs associated with them StartRestore(*stork_crd.ApplicationRestore) ([]*stork_crd.ApplicationRestoreVolumeInfo, error) // Get the status of restore of the volumes specified in the status // for the restore spec GetRestoreStatus(*stork_crd.ApplicationRestore) ([]*stork_crd.ApplicationRestoreVolumeInfo, error) // Cancel the restore of volumes specified in the status CancelRestore(*stork_crd.ApplicationRestore) error }
BackupRestorePluginInterface Interface to backup and restore volumes
type CloneNotSupported ¶ added in v1.4.0
type CloneNotSupported struct{}
CloneNotSupported to be used by drivers that don't support volume clone
func (*CloneNotSupported) CreateVolumeClones ¶ added in v1.4.0
func (v *CloneNotSupported) CreateVolumeClones(*stork_crd.ApplicationClone) error
CreateVolumeClones returns ErrNotSupported
type ClonePluginInterface ¶ added in v1.4.0
type ClonePluginInterface interface {
CreateVolumeClones(*stork_crd.ApplicationClone) error
}
ClonePluginInterface Interface to clone volumes
type ClusterDomainsNotSupported ¶ added in v1.4.0
type ClusterDomainsNotSupported struct{}
ClusterDomainsNotSupported to be used by drivers that don't support cluster domains
func (*ClusterDomainsNotSupported) ActivateClusterDomain ¶ added in v1.4.0
func (c *ClusterDomainsNotSupported) ActivateClusterDomain(*stork_crd.ClusterDomainUpdate) error
ActivateClusterDomain activates a cluster domain
func (*ClusterDomainsNotSupported) DeactivateClusterDomain ¶ added in v1.4.0
func (c *ClusterDomainsNotSupported) DeactivateClusterDomain(*stork_crd.ClusterDomainUpdate) error
DeactivateClusterDomain deactivates a cluster domain
func (*ClusterDomainsNotSupported) GetClusterDomains ¶ added in v1.4.0
func (c *ClusterDomainsNotSupported) GetClusterDomains() (*stork_crd.ClusterDomains, error)
GetClusterDomains returns all the cluster domains and their status
type ClusterDomainsPluginInterface ¶ added in v1.4.0
type ClusterDomainsPluginInterface interface { // GetClusterDomains returns all the cluster domains and their status GetClusterDomains() (*stork_crd.ClusterDomains, error) // ActivateClusterDomain activates a cluster domain ActivateClusterDomain(*stork_crd.ClusterDomainUpdate) error // DeactivateClusterDomain deactivates a cluster domain DeactivateClusterDomain(*stork_crd.ClusterDomainUpdate) error }
ClusterDomainsPluginInterface Interface to manage cluster domains
type ClusterPairNotSupported ¶ added in v1.4.0
type ClusterPairNotSupported struct{}
ClusterPairNotSupported to be used by drivers that don't support pairing
func (*ClusterPairNotSupported) CreatePair ¶ added in v1.4.0
func (c *ClusterPairNotSupported) CreatePair(*stork_crd.ClusterPair) (string, error)
CreatePair Returns ErrNotSupported
func (*ClusterPairNotSupported) DeletePair ¶ added in v1.4.0
func (c *ClusterPairNotSupported) DeletePair(*stork_crd.ClusterPair) error
DeletePair Returns ErrNotSupported
type ClusterPairPluginInterface ¶ added in v1.4.0
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 // GetClusterID returns the clusterID for the driver GetClusterID() (string, error) // GroupSnapshotPluginInterface Interface for group snapshots GroupSnapshotPluginInterface // ClusterPairPluginInterface Interface to pair clusters ClusterPairPluginInterface // MigratePluginInterface Interface to migrate data between clusters MigratePluginInterface // ClusterDomainsPluginInterface Interface to manage cluster domains ClusterDomainsPluginInterface // BackupRestorePluginInterface Interface to backup and restore volumes BackupRestorePluginInterface // ClonePluginInterface Interface to clone volumes ClonePluginInterface // SnapshotRestorePluginInterface Interface to do in-place restore of volumes SnapshotRestorePluginInterface }
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 GroupSnapshotCreateResponse ¶ added in v1.4.0
type GroupSnapshotCreateResponse struct {
Snapshots []*stork_crd.VolumeSnapshotStatus
}
GroupSnapshotCreateResponse is the response for the group snapshot operation
type GroupSnapshotNotSupported ¶ added in v1.4.0
type GroupSnapshotNotSupported struct{}
GroupSnapshotNotSupported to be used by drivers that don't support group snapshots
func (*GroupSnapshotNotSupported) CreateGroupSnapshot ¶ added in v1.4.0
func (g *GroupSnapshotNotSupported) CreateGroupSnapshot(*stork_crd.GroupVolumeSnapshot) (*GroupSnapshotCreateResponse, error)
CreateGroupSnapshot returns ErrNotSupported
func (*GroupSnapshotNotSupported) DeleteGroupSnapshot ¶ added in v1.4.0
func (g *GroupSnapshotNotSupported) DeleteGroupSnapshot(*stork_crd.GroupVolumeSnapshot) error
DeleteGroupSnapshot returns ErrNotSupported
func (*GroupSnapshotNotSupported) GetGroupSnapshotStatus ¶ added in v1.4.0
func (g *GroupSnapshotNotSupported) GetGroupSnapshotStatus(*stork_crd.GroupVolumeSnapshot) (*GroupSnapshotCreateResponse, error)
GetGroupSnapshotStatus returns ErrNotSupported
type GroupSnapshotPluginInterface ¶ added in v1.4.0
type GroupSnapshotPluginInterface interface { // CreateGroupSnapshot creates a group snapshot with the given pvcs CreateGroupSnapshot(snap *stork_crd.GroupVolumeSnapshot) (*GroupSnapshotCreateResponse, error) // GetGroupSnapshotStatus returns status of group snapshot GetGroupSnapshotStatus(snap *stork_crd.GroupVolumeSnapshot) (*GroupSnapshotCreateResponse, error) // DeleteGroupSnapshot delete a group snapshot with the given spec DeleteGroupSnapshot(snap *stork_crd.GroupVolumeSnapshot) error }
GroupSnapshotPluginInterface is used to perform group snapshot operations
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 ¶ added in v1.4.0
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.MigrationVolumeInfo, error) // Get the status of migration of the volumes specified in the status // for the migration spec GetMigrationStatus(*stork_crd.Migration) ([]*stork_crd.MigrationVolumeInfo, 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 ¶ added in v1.4.0
type MigrationNotSupported struct{}
MigrationNotSupported to be used by drivers that don't support migration
func (*MigrationNotSupported) CancelMigration ¶ added in v1.4.0
func (m *MigrationNotSupported) CancelMigration(*stork_crd.Migration) error
CancelMigration returns ErrNotSupported
func (*MigrationNotSupported) GetMigrationStatus ¶ added in v1.4.0
func (m *MigrationNotSupported) GetMigrationStatus(*stork_crd.Migration) ([]*stork_crd.MigrationVolumeInfo, error)
GetMigrationStatus returns ErrNotSupported
func (*MigrationNotSupported) StartMigration ¶ added in v1.4.0
func (m *MigrationNotSupported) StartMigration(*stork_crd.Migration) ([]*stork_crd.MigrationVolumeInfo, error)
StartMigration returns ErrNotSupported
func (*MigrationNotSupported) UpdateMigratedPersistentVolumeSpec ¶ added in v1.4.0
func (m *MigrationNotSupported) UpdateMigratedPersistentVolumeSpec( runtime.Unstructured, ) (runtime.Unstructured, error)
UpdateMigratedPersistentVolumeSpec returns ErrNotSupported
type NodeInfo ¶
type NodeInfo struct { // StorageID is a unique identifier for the storage node StorageID string // SchedulerID is a unique identifier for the scheduler node SchedulerID 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
func RemoveDuplicateOfflineNodes ¶ added in v1.4.0
RemoveDuplicateOfflineNodes Removes duplicate offline nodes from the list which have the same IP as an online 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" )
type SnapshotRestorePluginInterface ¶ added in v1.4.0
type SnapshotRestorePluginInterface interface { // StartVolumeSnapshotRestore will prepare volume for restore StartVolumeSnapshotRestore(*stork_crd.VolumeSnapshotRestore) error // CompleteVolumeSnapshotRestore will perform in-place restore for given snapshot and associated pvc // Returns error if restore failed CompleteVolumeSnapshotRestore(*stork_crd.VolumeSnapshotRestore) error // GetVolumeSnapshotRestore returns snapshot restore status GetVolumeSnapshotRestoreStatus(*stork_crd.VolumeSnapshotRestore) error // CleanupSnapshotRestoreObjects deletes restore objects if any CleanupSnapshotRestoreObjects(*stork_crd.VolumeSnapshotRestore) error }
SnapshotRestorePluginInterface Interface to perform in place restore of volume