kubernetes

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2020 License: Apache-2.0 Imports: 40 Imported by: 0

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

View Source
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

func MetaUIDKeyFunc(obj interface{}) ([]string, error)

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) Activate

func (p *Plugin) Activate() error

Activate starts this Trident frontend.

func (*Plugin) Deactivate

func (p *Plugin) Deactivate() error

Deactivate stops this Trident frontend.

func (*Plugin) GetName

func (p *Plugin) GetName() string

GetName returns the name of 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

func (p *Plugin) RecordVolumeEvent(name, eventType, reason, message string)

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

func (p *Plugin) SupportsFeature(feature helpers.Feature) bool

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)

func (*Plugin) Version

func (p *Plugin) Version() string

Version returns the version of this Trident frontend (the detected K8S version).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL