provisioner

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParentDatasetParameter   = "parentDataset"
	SharePropertiesParameter = "shareProperties"
	HostnameParameter        = "hostname"
	TypeParameter            = "type"
	NodeNameParameter        = "node"
	ReserveSpaceParameter    = "reserveSpace"
)
View Source
const (
	DatasetPathAnnotation = "zfs.pv.kubernetes.io/zfs-dataset-path"
	ZFSHostAnnotation     = "zfs.pv.kubernetes.io/zfs-host"

	RefQuotaProperty       = "refquota"
	RefReservationProperty = "refreservation"
	ManagedByProperty      = "io.kubernetes.pv.zfs:managed_by"
	ReclaimPolicyProperty  = "io.kubernetes.pv.zfs:reclaim_policy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HostPathParameters

type HostPathParameters struct {
	// NodeName overrides the hostname if the Kubernetes node name is different than the ZFS target host. Used for Affinity
	NodeName string
}

type NFSParameters

type NFSParameters struct {
	// ShareProperties specifies additional properties to pass to 'zfs create sharenfs=%s'.
	ShareProperties string
}

type ZFSProvisioner

type ZFSProvisioner struct {
	InstanceName string
	// contains filtered or unexported fields
}

ZFSProvisioner implements the Provisioner interface to create and export ZFS volumes

func NewZFSProvisioner

func NewZFSProvisioner(instanceName string) (*ZFSProvisioner, error)

NewZFSProvisioner returns a new ZFSProvisioner based on a given optional zap.Logger. If none given, zaps default production logger is used.

func (*ZFSProvisioner) Delete

func (p *ZFSProvisioner) Delete(ctx context.Context, volume *core.PersistentVolume) error

Delete removes a given volume from the server

func (*ZFSProvisioner) Provision

Provision creates a PersistentVolume, sets quota and shares it via NFS.

type ZFSStorageClassParameters

type ZFSStorageClassParameters struct {
	// ParentDataset of the zpool. Needs to be existing on the target ZFS host.
	ParentDataset string
	// Hostname of the target ZFS host. Will be used to connect over SSH.
	Hostname     string
	NFS          *NFSParameters
	HostPath     *HostPathParameters
	ReserveSpace bool
}

ZFSStorageClassParameters represents the parameters on the `StorageClass` object. It is used to ease access and validate those parameters at run time.

func NewStorageClassParameters

func NewStorageClassParameters(parameters map[string]string) (*ZFSStorageClassParameters, error)

NewStorageClassParameters takes a storage class parameters, validates it for invalid configuration and returns a ZFSStorageClassParameters on success.

Jump to

Keyboard shortcuts

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