kubernetes

package
v19.10.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubernetesSyncPeriod       = 60 * time.Second
	KubernetesResizeSyncPeriod = 3 * time.Minute

	// 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"
	AnnStorageProvisioner     = "volume.beta.kubernetes.io/storage-provisioner"
	AnnDefaultStorageClass    = "storageclass.kubernetes.io/is-default-class"
	AnnMountOptions           = "volume.beta.kubernetes.io/mount-options"

	// Orchestrator-defined annotations
	AnnOrchestrator    = "netapp.io/" + config.OrchestratorName
	AnnPrefix          = config.OrchestratorName + ".netapp.io"
	AnnProtocol        = AnnPrefix + "/protocol"
	AnnSpaceReserve    = AnnPrefix + "/spaceReserve"
	AnnSnapshotPolicy  = AnnPrefix + "/snapshotPolicy"
	AnnSnapshotReserve = AnnPrefix + "/snapshotReserve"
	AnnSnapshotDir     = AnnPrefix + "/snapshotDirectory"
	AnnUnixPermissions = AnnPrefix + "/unixPermissions"
	AnnVendor          = AnnPrefix + "/vendor"
	AnnBackendID       = AnnPrefix + "/backendID"
	AnnExportPolicy    = AnnPrefix + "/exportPolicy"
	AnnBlockSize       = AnnPrefix + "/blockSize"
	AnnFileSystem      = AnnPrefix + "/fileSystem"
	AnnCloneFromPVC    = AnnPrefix + "/cloneFromPVC"
	AnnSplitOnClone    = AnnPrefix + "/splitOnClone"
	AnnNotManaged      = AnnPrefix + "/notManaged"
)

Variables

This section is empty.

Functions

func CreateISCSIPersistentVolumeSource

func CreateISCSIPersistentVolumeSource(
	k8sClient k8sclient.Interface, kubeVersion *k8sutilversion.Version, vol *storage.VolumeExternal,
) (*v1.ISCSIPersistentVolumeSource, error)

func CreateNFSVolumeSource

func CreateNFSVolumeSource(vol *storage.VolumeExternal) *v1.NFSVolumeSource

func GetPersistentVolumeClaimClass

func GetPersistentVolumeClaimClass(claim *v1.PersistentVolumeClaim) string

GetPersistentVolumeClaimClass returns StorageClassName. If no storage class was requested, it returns "".

func IsPanicKubeVersion

func IsPanicKubeVersion(err error) bool

func IsUnsupportedKubeVersion

func IsUnsupportedKubeVersion(err error) bool

func PatchPV

func PatchPV(kubeClient kubernetes.Interface,
	pv *v1.PersistentVolume,
	pvUpdated *v1.PersistentVolume) (*v1.PersistentVolume, error)

PatchPV patches a PV after an update

func PatchPVC

PatchPVC patches a PVC spec after an update

func PatchPVCStatus

func PatchPVCStatus(kubeClient kubernetes.Interface,
	pvc *v1.PersistentVolumeClaim,
	pvcUpdated *v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error)

PatchPVCStatus patches a PVC status after an update

func ValidateKubeVersion

func ValidateKubeVersion(versionInfo *k8sversion.Info) (kubeVersion *k8sutilversion.Version, err error)

Types

type KubernetesPlugin

type KubernetesPlugin interface {
	frontend.Plugin
	ImportVolume(request *storage.ImportVolumeRequest) (*storage.VolumeExternal, error)
}

type PanicKubeVersionError

type PanicKubeVersionError struct {
	Message string
}

func NewPanicKubeVersionError

func NewPanicKubeVersionError(msg string) *PanicKubeVersionError

func (*PanicKubeVersionError) Error

func (err *PanicKubeVersionError) Error() string

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(o core.Orchestrator, apiServerIP, kubeConfigPath string) (*Plugin, error)

func NewPluginInCluster

func NewPluginInCluster(o core.Orchestrator) (*Plugin, error)

func (*Plugin) Activate

func (p *Plugin) Activate() error

func (*Plugin) Deactivate

func (p *Plugin) Deactivate() error

func (*Plugin) GetName

func (p *Plugin) GetName() string

func (*Plugin) GetPVCForPV

func (p *Plugin) GetPVCForPV(pv *v1.PersistentVolume) (*v1.PersistentVolumeClaim, error)

GetPVCForPV returns the PVC for a PV.

func (*Plugin) GetPVForPVC

func (p *Plugin) GetPVForPVC(claim *v1.PersistentVolumeClaim) (*v1.PersistentVolume, error)

GetPVForPVC returns the PV for a bound PVC.

func (*Plugin) ImportVolume

func (p *Plugin) ImportVolume(request *storage.ImportVolumeRequest) (*storage.VolumeExternal, error)

func (*Plugin) Version

func (p *Plugin) Version() string

type StorageClassSummary

type StorageClassSummary struct {
	Parameters                    map[string]string
	MountOptions                  []string
	PersistentVolumeReclaimPolicy *v1.PersistentVolumeReclaimPolicy
	AllowVolumeExpansion          *bool
}

StorageClassSummary captures relevant fields in the storage class that are needed during PV creation or PV resize.

type UnsupportedKubeVersionError

type UnsupportedKubeVersionError struct {
	Message string
}

func NewUnsupportedKubeVersionError

func NewUnsupportedKubeVersionError(msg string) *UnsupportedKubeVersionError

func (*UnsupportedKubeVersionError) Error

func (err *UnsupportedKubeVersionError) Error() string

Jump to

Keyboard shortcuts

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