controller

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitFlags

func InitFlags(cmd *cobra.Command) error

InitFlags adds flags used to configure the controller on the cobra Command.

Types

type ProvisionController

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

Controller is a controller that watch PersistentVolumeClaim adn provisions PersistentVolumes.

func NewProvisioningController

func NewProvisioningController(p Provisioner) (*ProvisionController, error)

NewProvisionController creates a new provision controller with the given Provisioner.

func (*ProvisionController) Start

func (c *ProvisionController) Start() error

Start starts all the controller loop.

The contorller will gracefully stop upon receiving SIGTERM or SIGINT.

type ProvisionOptions

type ProvisionOptions struct {
	// VolumeName is the name of the appropriate PersistentVolume. It can be used
	// to generate the volume name on the underlying storage provider.
	VolumeName string

	// PersistentVolumeClaim is a reference to the claim that lead to
	// provisioning of a new PersistentVolume. Provisioners *must* create a PV
	// that would be matched by this PersistentVolumeClaim (i.e. with required
	// capacity, accessMode, labels matching PersistentVolumeClaim.Spec.Selector
	// and so on).
	PersistentVolumeClaim *v1.PersistentVolumeClaim

	// StorageClass is a reference to the storage class that is used for
	// provisioning for this volume
	StorageClass *storagev1.StorageClass
}

ProvisionOptions is passed to Provisioner.Provision and contains all the necessary information required to provision a volume.

type Provisioner

type Provisioner interface {
	Name() string
	Provision(ProvisionOptions) (*v1.PersistentVolume, error)
	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 Resizer

type Resizer interface {
	Resize(*v1.PersistentVolume, int64) error
}

Resizer is an optional interface implemented by provisioners to allow resizing of PersistentVolumes.

Jump to

Keyboard shortcuts

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