controller

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2016 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IgnoredError

type IgnoredError struct {
	Reason string
}

func (*IgnoredError) Error

func (e *IgnoredError) Error() string

type ProvisionController

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

ProvisionController is a controller that provisions PersistentVolumes for PersistentVolumeClaims.

func NewProvisionController

func NewProvisionController(
	client kubernetes.Interface,
	resyncPeriod time.Duration,
	provisionerName string,
	provisioner Provisioner,
	serverGitVersion string,
	exponentialBackOffOnError bool,
) *ProvisionController

func (*ProvisionController) Run

func (ctrl *ProvisionController) Run(stopCh <-chan struct{})

type Provisioner

type Provisioner interface {
	// Provision creates a volume i.e. the storage asset and returns a PV object
	// for the volume
	Provision(VolumeOptions) (*v1.PersistentVolume, error)
	// Delete removes the storage asset that was created by Provision backing the
	// given PV. Does not delete the PV object itself.
	//
	// May return IgnoredError to indicate that the call has been ignored and no
	// action taken. In case multiple provisioners are serving the same storage
	// class, provisioners may ignore PVs they are not responsible for (e.g. ones
	// they didn't create). The controller will act accordingly, i.e. it won't
	// emit a misleading VolumeFailedDelete event.
	Delete(*v1.PersistentVolume) error
}

Provisioner is an interface that creates templates for PersistentVolumes and can create the volume as a new resource in the infrastructure provider. It can also remove the volume it created from the underlying storage provider.

type VolumeOptions

type VolumeOptions struct {
	// Capacity is the size of a volume.
	Capacity resource.Quantity
	// AccessModes of a volume
	AccessModes []v1.PersistentVolumeAccessMode
	// Reclamation policy for a persistent volume
	PersistentVolumeReclaimPolicy v1.PersistentVolumeReclaimPolicy
	// PV.Name of the appropriate PersistentVolume. Used to generate cloud
	// volume name.
	PVName string
	// Volume provisioning parameters from StorageClass
	Parameters map[string]string
	// Volume selector from PersistentVolumeClaim
	Selector *unversioned.LabelSelector
}

VolumeOptions contains option information about a volume https://github.com/kubernetes/kubernetes/blob/release-1.4/pkg/volume/plugins.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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