local

package
v1.2.1 Latest Latest
Warning

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

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

README

Local drivers:

LVM

PMEM-Direct:

MountPoint:

Device:

Code:

adapter:

Add support for yoda plugin; schedule pod with storage capacity.

Documentation

Index

Constants

View Source
const (
	LOCAL_GRPC_PROVISION                 = "LOCAL_GRPC_PROVISION"
	LOCAL_HOSTNAME_AS_TOPO               = "LOCAL_HOSTNAME_AS_TOPO"
	LOCAL_TOPO_KEY_DEFINED               = "LOCAL_TOPO_KEY_DEFINED"
	CAPACITY_TO_NODE                     = "CAPACITY_TO_NODE"
	LOCAL_SPARSE_TEMPLATE_FILEDIR        = "LOCAL_SPARSE_TEMPLATE_FILEDIR"
	LOCAL_SPARSE_TEMPLATE_SIZE           = "LOCAL_SPARSE_TEMPLATE_SIZE"
	LOCAL_SPARSE_TOTAL_AVAILABLE_GI      = "LOCAL_SPARSE_TOTAL_AVAILABLE_GI"
	LOCAL_SPARSE_TOTAL_AVAILABLE_PERCENT = "LOCAL_SPARSE_TOTAL_AVAILABLE_PERCENT"
)
View Source
const (
	// LvmVolumeType lvm volume type
	LvmVolumeType = "LVM"
	// PmemVolumeType lvm volume type
	PmemVolumeType = "PMEM"
	// QuotaPathVolumeType ...
	QuotaPathVolumeType = "QuotaPath"
	// LoopDeviceVolumeType type defines user want to use loopdevice local disk
	LoopDeviceVolumeType = "LoopDevice"
	// MountPointType type
	MountPointType = "MountPoint"
	// DeviceVolumeType type
	DeviceVolumeType = "Device"
	// DeviceVolumeKey type
	DeviceVolumeKey = "device"
	// VolumeTypeKey volume type key words
	VolumeTypeKey = "volumeType"

	// TopologyNodeKey define host name of node
	TopologyNodeKey = "kubernetes.io/hostname"
	// TopologyYodaNodeKey define host name of node
	TopologyYodaNodeKey = "topology.yodaplugin.csi.alibabacloud.com/hostname"
	// PvcNameTag in annotations
	PvcNameTag = "csi.storage.k8s.io/pvc/name"
	// PvcNsTag in annotations
	PvcNsTag = "csi.storage.k8s.io/pvc/namespace"
	// NodeSchedueTag in annotations
	NodeSchedueTag = "volume.kubernetes.io/selected-node"
	// StorageSchedueTag in annotations
	StorageSchedueTag = "volume.kubernetes.io/selected-storage"
	// LastAppliyAnnotationTag tag
	LastAppliyAnnotationTag = "kubectl.kubernetes.io/last-applied-configuration"
	// CsiProvisionerIdentity tag
	CsiProvisionerIdentity = "storage.kubernetes.io/csiProvisionerIdentity"
	// CsiProvisionerTag tag
	CsiProvisionerTag = "volume.beta.kubernetes.io/storage-provisioner"
	// QuotaRootPath tag
	QuotaRootPath = "rootPath"
)
View Source
const (
	// NsenterCmd is the nsenter command
	NsenterCmd = "/nsenter --mount=/proc/1/ns/mnt --ipc=/proc/1/ns/ipc --net=/proc/1/ns/net --uts=/proc/1/ns/uts "
	// VgNameTag is the vg name tag
	VgNameTag = "vgName"
	// PmemType tag
	PmemType = "pmemType"
	// VolumeTypeTag is the pv type tag
	VolumeTypeTag = "volumeType"
	// PvTypeTag is the pv type tag
	PvTypeTag = "pvType"
	// FsTypeTag is the fs type tag
	FsTypeTag = "fsType"
	// LvmTypeTag is the lvm type tag
	LvmTypeTag = "lvmType"
	// PmemBlockDev is the pmem type tag
	PmemBlockDev = "pmemBlockDev"
	// NodeAffinity is the pv node schedule tag
	NodeAffinity = "nodeAffinity"
	// ProjQuotaFullPath is the path of project quota
	ProjQuotaFullPath = "projQuotaFullPath"
	// ProjQuotaFullPath is the path of project quota
	LoopDeviceFullPath = "loopDeviceFullPath"
	// ProjQuotaProjectID is the project id of project quota
	ProjQuotaProjectID = "projectID"
	// LocalDisk local disk
	LocalDisk = "localdisk"
	// CloudDisk cloud disk
	CloudDisk = "clouddisk"
	// LinearType linear type
	LinearType = "linear"
	// StripingType striping type
	StripingType = "striping"
	// DefaultFs default fs
	DefaultFs = "ext4"
	// DefaultPmemType default lvm
	DefaultPmemType = "lvm"
	// DefaultNodeAffinity default NodeAffinity
	DefaultNodeAffinity = "true"
)
View Source
const (
	// MetadataURL is metadata server url
	MetadataURL = "http://100.100.100.200/latest/meta-data/"
	// InstanceID is the instance id tag
	InstanceID = "instance-id"
	// RegionIDTag is the region id tag
	RegionIDTag = "region-id"
	// MkfsOptions tag
	MkfsOptions = "mkfsOptions"
)

Variables

View Source
var (
	// DeviceChars is chars of a device
	DeviceChars = []string{"b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
)
View Source
var ErrParse = errors.New("Cannot parse output of blkid")

ErrParse is an error that is returned when parse operation fails

View Source
var LocalDeviceList = []*StorageCapacity{}

LocalDeviceList the local device type list, only support alibaba cloud local disks;

View Source
var LocalDeviceLoopIndex = 0

LocalDeviceLoopIndex local device check index

View Source
var LocalDeviceUpdate = false

LocalDeviceUpdate alibaba cloud local disk is constant, no need reconcile

PmemSupportType ...

Functions

func GetMetaData

func GetMetaData(resource string) string

GetMetaData get host regionid, zoneid

func GlobalConfigSet added in v1.0.6

func GlobalConfigSet(region, nodeID, driverName string)

GlobalConfigSet set Global Config

func IsPmemSupported added in v1.1.7

func IsPmemSupported(nodeName string, kubeClient kubernetes.Interface) (pmemEnable bool, pmemType string)

func NewNodeServer

func NewNodeServer(d *csicommon.CSIDriver, dName, nodeID string) csi.NodeServer

NewNodeServer create a NodeServer object

Types

type Local

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

Local the Local struct

func NewDriver

func NewDriver(nodeID, endpoint string) *Local

NewDriver create the identity/node/controller server and disk driver

func (*Local) Run

func (lvm *Local) Run()

Run start a new server

type StorageCapacity added in v1.1.7

type StorageCapacity struct {
	Type       string `json:"type,omitempty"`
	Name       string `json:"name,omitempty"`
	Capacity   uint64 `json:"capacity,omitempty"`
	DeviceType string `json:"devicetype,omitempty"`
	MountPoint string `json:"mountPoint,omitempty"`
}

StorageCapacity define storage pool details

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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