Documentation ¶
Overview ¶
Copyright 2019 NetApp, Inc. All Rights Reserved.
Copyright 2019 NetApp, Inc. All Rights Reserved.
Copyright 2019 NetApp, Inc. All Rights Reserved.
Copyright 2019 NetApp, Inc. All Rights Reserved.
Index ¶
- Constants
- func MetaUIDKeyFunc(obj interface{}) ([]string, error)
- type K8SHelperPlugin
- type Plugin
- func (p *Plugin) Activate() error
- func (p *Plugin) Deactivate() error
- func (p *Plugin) GetName() string
- func (p *Plugin) GetSnapshotConfig(volumeName, snapshotName string) (*storage.SnapshotConfig, error)
- func (p *Plugin) GetVolumeConfig(name string, sizeBytes int64, parameters map[string]string, ...) (*storage.VolumeConfig, error)
- func (p *Plugin) ImportVolume(request *storage.ImportVolumeRequest) (*storage.VolumeExternal, error)
- func (p *Plugin) RecordVolumeEvent(name, eventType, reason, message string)
- func (p *Plugin) SupportsFeature(feature helpers.Feature) bool
- func (p *Plugin) UpgradeVolume(request *storage.UpgradeVolumeRequest) (*storage.VolumeExternal, error)
- func (p *Plugin) Version() string
Constants ¶
const ( CacheSyncPeriod = 60 * time.Second PreSyncCacheWaitPeriod = 10 * time.Second PostSyncCacheWaitPeriod = 30 * time.Second ResizeSyncPeriod = 3 * time.Minute PVDeleteWaitPeriod = 30 * time.Second PodDeleteWaitPeriod = 60 * time.Second ImportPVCacheWaitPeriod = 75 * time.Second CacheBackoffInitialInterval = 1 * time.Second CacheBackoffRandomizationFactor = 0.1 CacheBackoffMultiplier = 1.414 CacheBackoffMaxInterval = 5 * time.Second // Kubernetes-defined storage class parameters K8sFsType = "fsType" // Kubernetes-defined annotations // (Based on kubernetes/pkg/controller/volume/persistentvolume/controller.go) AnnClass = "volume.beta.kubernetes.io/storage-class" AnnDynamicallyProvisioned = "pv.kubernetes.io/provisioned-by" AnnBindCompleted = "pv.kubernetes.io/bind-completed" AnnStorageProvisioner = "volume.beta.kubernetes.io/storage-provisioner" // Kubernetes-defined finalizers FinalizerPVProtection = "kubernetes.io/pv-protection" AnnProtocol = annPrefix + "/protocol" AnnSnapshotPolicy = annPrefix + "/snapshotPolicy" AnnSnapshotReserve = annPrefix + "/snapshotReserve" AnnSnapshotDir = annPrefix + "/snapshotDirectory" AnnUnixPermissions = annPrefix + "/unixPermissions" AnnExportPolicy = annPrefix + "/exportPolicy" AnnBlockSize = annPrefix + "/blockSize" AnnFileSystem = annPrefix + "/fileSystem" AnnCloneFromPVC = annPrefix + "/cloneFromPVC" AnnSplitOnClone = annPrefix + "/splitOnClone" AnnNotManaged = annPrefix + "/notManaged" AnnImportOriginalName = annPrefix + "/importOriginalName" AnnImportBackendUUID = annPrefix + "/importBackendUUID" )
Variables ¶
This section is empty.
Functions ¶
func MetaUIDKeyFunc ¶
MetaUIDKeyFunc is a KeyFunc which knows how to make keys for API objects which implement meta.Interface. The key is the object's UID.
Types ¶
type K8SHelperPlugin ¶
type K8SHelperPlugin interface { frontend.Plugin UpgradeVolume(request *storage.UpgradeVolumeRequest) (*storage.VolumeExternal, error) }
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶
func NewPlugin(o core.Orchestrator, apiServerIP, kubeConfigPath string) (*Plugin, error)
NewPlugin instantiates this plugin when running outside a pod.
func NewPluginInCluster ¶
func NewPluginInCluster(o core.Orchestrator) (*Plugin, error)
NewPluginInCluster instantiates this plugin when running inside a pod.
func (*Plugin) Deactivate ¶
Deactivate stops this Trident frontend.
func (*Plugin) GetSnapshotConfig ¶
func (p *Plugin) GetSnapshotConfig(volumeName, snapshotName string) (*storage.SnapshotConfig, error)
GetSnapshotConfig accepts the attributes of a snapshot being requested by the CSI provisioner and returns a SnapshotConfig structure as needed by Trident to create a new snapshot.
func (*Plugin) GetVolumeConfig ¶
func (p *Plugin) GetVolumeConfig( name string, sizeBytes int64, parameters map[string]string, protocol config.Protocol, accessModes []config.AccessMode, volumeMode config.VolumeMode, fsType string, ) (*storage.VolumeConfig, error)
GetVolumeConfig accepts the attributes of a volume being requested by the CSI provisioner, combines those with PVC and storage class info retrieved from the K8S API server, and returns a VolumeConfig structure as needed by Trident to create a new volume.
func (*Plugin) ImportVolume ¶
func (p *Plugin) ImportVolume(request *storage.ImportVolumeRequest) (*storage.VolumeExternal, error)
func (*Plugin) RecordVolumeEvent ¶
RecordVolumeEvent accepts the name of a CSI volume (i.e. a PV name), finds the associated PVC, and posts and event message on the PVC object with the K8S API server.
func (*Plugin) SupportsFeature ¶
SupportsFeature accepts a CSI feature and returns true if the feature exists and is supported.
func (*Plugin) UpgradeVolume ¶
func (p *Plugin) UpgradeVolume(request *storage.UpgradeVolumeRequest) (*storage.VolumeExternal, error)