provisioner

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AnnProvisionedBy is the external provisioner annotation in PV object
	AnnProvisionedBy = "pv.kubernetes.io/provisioned-by"

	// DefaultMountPoint is the mount point of raid device on the host under in knode
	DefaultMountPoint = "/mnt/disks/raid0"

	// DefaultFsType is the filesystem type to mount
	DefaultFsType = "ext4"

	// LocalFilesystemEnv will contain the filesystm path when script is invoked
	LocalFilesystemEnv = "LOCAL_PV_FILESYSTEM"
)
View Source
const (
	ActionTypeCreate = "create"
	ActionTypeDelete = "delete"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionType

type ActionType string

type CacheConfig

type CacheConfig struct {
	// Unique name of this provisioner
	ProvisionerName string
	// Cache to store PVs managed by this provisioner
	Cache *VolumeCache
	// InformerFactory gives access to informers for the controller.
	InformerFactory informers.SharedInformerFactory
}

type LocalVolumeProvisioner

type LocalVolumeProvisioner struct {
	*CacheConfig
	// contains filtered or unexported fields
}

func NewProvisioner

func NewProvisioner(ctx context.Context, kubeClient *clientset.Clientset, namespace, helperImage, configMapName,
	serviceAccountName string) *LocalVolumeProvisioner

func (*LocalVolumeProvisioner) Delete

func (*LocalVolumeProvisioner) SetImagePullSecret

func (p *LocalVolumeProvisioner) SetImagePullSecret(secret string)

type Populator

type Populator struct {
	*CacheConfig
}

The Populator uses an Informer to populate the VolumeCache.

func NewPopulator

func NewPopulator(config *CacheConfig) *Populator

NewPopulator returns a Populator object to update the PV cache

type VolumeCache

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

VolumeCache keeps all the PersistentVolumes that have been created by this provisioner. It is periodically updated by the Populator. The Deleter and Discoverer use the VolumeCache to check on created PVs

func NewVolumeCache

func NewVolumeCache() *VolumeCache

NewVolumeCache creates a new PV cache object for storing PVs created by this provisioner.

func (*VolumeCache) AddPV

func (cache *VolumeCache) AddPV(pv *corev1.PersistentVolume)

AddPV adds the PV object to the cache

func (*VolumeCache) DeletePV

func (cache *VolumeCache) DeletePV(pvName string)

DeletePV deletes the PV object from the cache

func (*VolumeCache) GetPV

func (cache *VolumeCache) GetPV(pvName string) (*corev1.PersistentVolume, bool)

GetPV returns the PV object given the PV name

func (*VolumeCache) ListPVs

func (cache *VolumeCache) ListPVs() []*corev1.PersistentVolume

ListPVs returns a list of all the PVs in the cache

func (*VolumeCache) UpdatePV

func (cache *VolumeCache) UpdatePV(pv *corev1.PersistentVolume)

UpdatePV updates the PV object in the cache

type VolumeOptions

type VolumeOptions struct {
	Name        string
	Path        string
	Node        string
	SizeInBytes int64
	Mode        corev1.PersistentVolumeMode
}

Jump to

Keyboard shortcuts

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