csi

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package csi contains the CSI driver implementation

Index

Constants

View Source
const (
	// DriverName is the name of the CSI driver
	DriverName = "csi.proxmox.sinextra.dev"
	// DriverVersion is the version of the CSI driver
	DriverVersion = "0.4.0"
	// DriverSpecVersion CSI spec version
	DriverSpecVersion = "1.9.0"

	// StorageIDKey is the ID of the Proxmox storage
	StorageIDKey = "storage"
	// StorageCacheKey is the cache type, can be one of "directsync", "none", "writeback", "writethrough"
	StorageCacheKey = "cache"
	// StorageSSDKey is it ssd disk
	StorageSSDKey = "ssd"

	// StorageDiskIOPSKey is maximum r/w I/O in operations per second
	StorageDiskIOPSKey = "diskIOPS"
	// StorageDiskMBpsKey is maximum r/w throughput in MB/s
	StorageDiskMBpsKey = "diskMBps"

	// StorageBlockSizeKey the block size when formatting a volume
	StorageBlockSizeKey = "blockSize"

	// StorageInodeSizeKey the inode size when formatting a volume
	StorageInodeSizeKey = "inodeSize"

	// MaxVolumesPerNode is the maximum number of volumes that can be attached to a node
	MaxVolumesPerNode = 24
	// MinVolumeSize is the minimum size of a volume
	MinVolumeSize = 1 // GB
	// DefaultVolumeSize is the default size of a volume
	DefaultVolumeSize = 10 // GB

	// EncryptionPassphraseKey is the encryption passphrase secret key
	EncryptionPassphraseKey = "encryption-passphrase"
)
View Source
const (
	// FSTypeExt4 represents the ext4 filesystem type
	FSTypeExt4 = "ext4"
	// FSTypeXfs represents the xfs filesystem type
	FSTypeXfs = "xfs"
)

constants for fstypes

View Source
const (
	// TaskStatusCheckInterval is the interval in seconds to check the status of a task
	TaskStatusCheckInterval = 5
	// TaskTimeout is the timeout in seconds for all task
	TaskTimeout = 30

	// ErrorNotFound not found error message
	ErrorNotFound string = "not found"
)

Variables

This section is empty.

Functions

func ParseEndpoint

func ParseEndpoint(endpoint string) (string, string, error)

ParseEndpoint parses the endpoint string and returns the scheme and address

Types

type ControllerService

type ControllerService struct {
	Cluster *proxmox.Cluster
	Kclient clientkubernetes.Interface
	// contains filtered or unexported fields
}

ControllerService is the controller service for the CSI driver

func NewControllerService

func NewControllerService(kclient *clientkubernetes.Clientset, cloudConfig string) (*ControllerService, error)

NewControllerService returns a new controller service

func (*ControllerService) ControllerExpandVolume

ControllerExpandVolume expand a volume

func (*ControllerService) ControllerGetCapabilities

ControllerGetCapabilities get controller capabilities.

func (*ControllerService) ControllerGetVolume

ControllerGetVolume get a volume

func (*ControllerService) ControllerModifyVolume added in v0.5.0

ControllerModifyVolume modify a volume

func (*ControllerService) ControllerPublishVolume

ControllerPublishVolume publish a volume

func (*ControllerService) ControllerUnpublishVolume

ControllerUnpublishVolume unpublish a volume

func (*ControllerService) CreateSnapshot

CreateSnapshot create a snapshot

func (*ControllerService) CreateVolume

CreateVolume creates a volume

func (*ControllerService) DeleteSnapshot

DeleteSnapshot delete a snapshot

func (*ControllerService) DeleteVolume

DeleteVolume deletes a volume.

func (*ControllerService) GetCapacity

GetCapacity get capacity

func (*ControllerService) ListSnapshots

ListSnapshots list snapshots

func (*ControllerService) ListVolumes

ListVolumes list volumes

func (*ControllerService) ValidateVolumeCapabilities

ValidateVolumeCapabilities validate volume capabilities

type IdentityService

type IdentityService struct{}

IdentityService is the identity service for the CSI driver

func NewIdentityService

func NewIdentityService() *IdentityService

NewIdentityService returns a new identity service

func (*IdentityService) GetPluginCapabilities

GetPluginCapabilities returns the capabilities of the plugin

func (*IdentityService) GetPluginInfo

GetPluginInfo returns the name and version of the plugin

func (*IdentityService) Probe

Probe returns the health and readiness of the plugin

type NodeService

type NodeService struct {
	Mount mount.IMount
	// contains filtered or unexported fields
}

NodeService is the node service for the CSI driver

func NewNodeService

func NewNodeService(nodeID string, clientSet kubernetes.Interface) *NodeService

NewNodeService returns a new NodeService

func (*NodeService) NodeExpandVolume

NodeExpandVolume expand the volume

func (*NodeService) NodeGetCapabilities

NodeGetCapabilities get the node capabilities

func (*NodeService) NodeGetInfo

func (n *NodeService) NodeGetInfo(ctx context.Context, request *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

NodeGetInfo get the node info

func (*NodeService) NodeGetVolumeStats

NodeGetVolumeStats get the volume stats

func (*NodeService) NodePublishVolume

NodePublishVolume mounts the volume on the node.

func (*NodeService) NodeStageVolume

NodeStageVolume is called by the CO when a workload that wants to use the specified volume is placed (scheduled) on a node.

func (*NodeService) NodeUnpublishVolume

NodeUnpublishVolume unmount the volume from the target path

func (*NodeService) NodeUnstageVolume

NodeUnstageVolume is called by the CO when a workload that was using the specified volume is being moved to a different node.

Jump to

Keyboard shortcuts

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