pkg

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Gi          uint64 = 1024 * 1024 * 1024
	Mi          uint64 = 1024 * 1024
	DefaultPort int32  = 23000

	StrategyBinpack StrategyType = "binpack"
	StrategySpread  StrategyType = "spread"

	AgentName           string = "open-local-agent"
	ProvisionerNameYoda string = "yodaplugin.csi.alibabacloud.com"
	ProvisionerName     string = "local.csi.aliyun.com"
	SchedulerName       string = "open-local-scheduler"

	EnvLogLevel = "LogLevel"
	LogPanic    = "Panic"
	LogFatal    = "Fatal"
	LogError    = "Error"
	LogWarn     = "Warn"
	LogInfo     = "Info"
	LogDebug    = "Debug"
	LogTrace    = "Trace"

	KubernetesNodeIdentityKey = "kubernetes.io/hostname"
	//TODO(yuzhi.wx) need to confirm with jubao
	VolumeTypeKey    = "volumeType"
	VolumeFSTypeKey  = "fsType"
	VolumeMediaType  = "mediaType"
	VolumeFSTypeExt4 = "ext4"
	VolumeFSTypeExt3 = "ext3"
	VolumeFSTypeXFS  = "xfs"

	PVCName      = "csi.storage.k8s.io/pvc/name"
	PVCNameSpace = "csi.storage.k8s.io/pvc/namespace"
	VGName       = "vgName"
	MPName       = "MountPoint"
	DeviceName   = "Device"
	// VolumeType MUST BE case sensitive
	VolumeTypeMountPoint VolumeType = "MountPoint"
	VolumeTypeLVM        VolumeType = "LVM"
	VolumeTypeDevice     VolumeType = "Device"
	VolumeTypeQuota      VolumeType = "Quota"
	VolumeTypeUnknown    VolumeType = "Unknown"
	MediaTypeSSD         MediaType  = "ssd"
	MediaTypeHHD         MediaType  = "hdd"
	MediaTypeUnspecified MediaType  = "Unspecified"

	// This annotation is added to a PVC that has been triggered by scheduler to
	// be dynamically provisioned. Its value is the name of the selected node.
	AnnSelectedNode                      = "volume.kubernetes.io/selected-node"
	LabelReschduleTimestamp              = "pod.oecp.io/reschdule-timestamp"
	EnvExpandSnapInterval                = "Expand_Snapshot_Interval"
	TagSnapshot                          = "SnapshotName"
	PendingWithoutScheduledFieldSelector = "status.phase=Pending,spec.nodeName="
	TriggerPendingPodCycle               = time.Second * 300

	ParamSnapshotName            = "yoda.io/snapshot-name"
	ParamSnapshotReadonly        = "csi.aliyun.com/readonly"
	ParamSnapshotInitialSize     = "csi.aliyun.com/snapshot-initial-size"
	ParamSnapshotThreshold       = "csi.aliyun.com/snapshot-expansion-threshold"
	ParamSnapshotExpansionSize   = "csi.aliyun.com/snapshot-expansion-size"
	EnvSnapshotPrefix            = "SNAPSHOT_PREFIX"
	DefaultSnapshotPrefix        = "snap"
	DefaultSnapshotInitialSize   = 4 * 1024 * 1024 * 1024
	DefaultSnapshotThreshold     = 0.5
	DefaultSnapshotExpansionSize = 1 * 1024 * 1024 * 1024

	NsenterCmd = "/bin/nsenter --mount=/proc/1/ns/mnt --ipc=/proc/1/ns/ipc --net=/proc/1/ns/net --uts=/proc/1/ns/uts "
)

Variables

Functions

This section is empty.

Types

type MediaType

type MediaType string

type NodeAntiAffinityWeight

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

func NewNodeAntiAffinityWeight

func NewNodeAntiAffinityWeight() *NodeAntiAffinityWeight

func (*NodeAntiAffinityWeight) Get

func (w *NodeAntiAffinityWeight) Get(volumeType VolumeType) int

func (*NodeAntiAffinityWeight) Items

func (w *NodeAntiAffinityWeight) Items(copy bool) map[VolumeType]int

func (*NodeAntiAffinityWeight) Put

func (w *NodeAntiAffinityWeight) Put(volumeType VolumeType, weight int)

type StorageSpecUpdateStatus

type StorageSpecUpdateStatus struct {
	Status   UpdateStatus                          `json:"status"`
	Reason   string                                `json:"reason"`
	SpecHash uint64                                `json:"specHash"`
	NewSpec  nodelocalstorage.NodeLocalStorageSpec `json:"newSpec"`
}

type StrategyType

type StrategyType string

type UpdateStatus

type UpdateStatus string
var (
	UpdateStatusPending  UpdateStatus = "pending"
	UpdateStatusAccepted UpdateStatus = "accepted"
	UpdateStatusFailed   UpdateStatus = "failed"
)

type VolumeType

type VolumeType string

func VolumeTypeFromString

func VolumeTypeFromString(s string) (VolumeType, error)

Directories

Path Synopsis
agent
apis
storage/v1alpha1
Package v1alpha1 is the v1alpha1 version of the API.
Package v1alpha1 is the v1alpha1 version of the API.
csi
lib
generated
clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/storage/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/storage/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
lvm

Jump to

Keyboard shortcuts

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