Documentation
¶
Overview ¶
Copyright 2020 NetApp, Inc. All Rights Reserved.
Copyright 2020 NetApp, Inc. All Rights Reserved.
Copyright 2020 NetApp, Inc. All Rights Reserved.
Copyright 2020 NetApp, Inc. All Rights Reserved.
Index ¶
- Constants
- func MetaNameKeyFunc(obj interface{}) ([]string, error)
- func MetaUIDKeyFunc(obj interface{}) ([]string, error)
- func TridentVolumeReferenceKeyFunc(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) GetNode(ctx context.Context, nodeName string) (*v1.Node, error)
- func (p *Plugin) GetNodeTopologyLabels(ctx context.Context, nodeName string) (map[string]string, error)
- func (p *Plugin) GetSnapshotConfig(volumeName, snapshotName string) (*storage.SnapshotConfig, error)
- func (p *Plugin) GetVolumeConfig(ctx context.Context, name string, _ int64, _ map[string]string, ...) (*storage.VolumeConfig, error)
- func (p *Plugin) ImportVolume(ctx context.Context, request *storage.ImportVolumeRequest) (*storage.VolumeExternal, error)
- func (p *Plugin) RecordNodeEvent(ctx context.Context, name, eventType, reason, message string)
- func (p *Plugin) RecordVolumeEvent(ctx context.Context, name, eventType, reason, message string)
- func (p *Plugin) SupportsFeature(ctx context.Context, feature helpers.Feature) bool
- func (p *Plugin) UpgradeVolume(ctx context.Context, 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 = 180 * time.Second CacheBackoffInitialInterval = 1 * time.Second CacheBackoffRandomizationFactor = 0.1 CacheBackoffMultiplier = 1.414 CacheBackoffMaxInterval = 5 * time.Second // Kubernetes-defined storage class parameters K8sFsType = "fsType" CSIParameterPrefix = "csi.storage.k8s.io/" // 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" AnnMirrorRelationship = annPrefix + "/mirrorRelationship" )
Variables ¶
This section is empty.
Functions ¶
func MetaNameKeyFunc ¶
MetaNameKeyFunc is a KeyFunc which knows how to make keys for API objects which implement meta.Interface. The key is the object's name.
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.
func TridentVolumeReferenceKeyFunc ¶
TridentVolumeReferenceKeyFunc is a KeyFunc which knows how to make keys for TridentVolumeReference CRs. The key is of the format "<CR namespace>_<referenced PVC namespce>/<referenced PVC name>".
Types ¶
type K8SHelperPlugin ¶
type K8SHelperPlugin interface { frontend.Plugin ImportVolume(ctx context.Context, request *storage.ImportVolumeRequest) (*storage.VolumeExternal, error) UpgradeVolume(ctx context.Context, request *storage.UpgradeVolumeRequest) (*storage.VolumeExternal, error) }
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
func NewPlugin ¶
func NewPlugin(orchestrator core.Orchestrator, masterURL, kubeConfigPath string) (*Plugin, error)
NewPlugin instantiates this plugin when running outside a pod.
func (*Plugin) Deactivate ¶
Deactivate stops this Trident frontend.
func (*Plugin) GetNodeTopologyLabels ¶
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( ctx context.Context, name string, _ int64, _ map[string]string, _ config.Protocol, _ []config.AccessMode, _ config.VolumeMode, fsType string, requisiteTopology, preferredTopology, _ []map[string]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( ctx context.Context, request *storage.ImportVolumeRequest, ) (*storage.VolumeExternal, error)
func (*Plugin) RecordNodeEvent ¶
RecordNodeEvent 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) 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( ctx context.Context, request *storage.UpgradeVolumeRequest, ) (*storage.VolumeExternal, error)