csi

package
v0.5.5 Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Overview

Copyright © 2021 Alibaba Group Holding Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright © 2021 Alibaba Group Holding Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// VolumeTypeKey volume type key words
	VolumeTypeKey = "volumeType"
	// LvmVolumeType lvm volume type
	LvmVolumeType = "LVM"
	// MountPointType type
	MountPointType = "MountPoint"
	// DeviceVolumeType type
	DeviceVolumeType = "Device"
	// 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"
	// 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"
	// StripingType striping type
	StripingType = "striping"
	// connection timeout
	DefaultConnectTimeout = 3

	// TopologyNodeKey define host name of node
	TopologyNodeKey = "kubernetes.io/hostname"
)
View Source
const (
	// VgNameTag is the vg name tag
	VgNameTag = "vgName"
	// 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"
	// NodeAffinity is the pv node schedule tag
	NodeAffinity = "nodeAffinity"
	// DefaultFs default fs
	DefaultFs = "ext4"
	// DefaultNodeAffinity default NodeAffinity
	DefaultNodeAffinity = "true"
	// LinearType linear type
	LinearType = "linear"
)
View Source
const (
	DefaultEndpoint                    string = "unix://tmp/csi.sock"
	DefaultDriverName                  string = "local.csi.aliyun.com"
	DefaultEphemeralVolumeDataFilePath string = "/var/lib/kubelet/open-local-volumes.json"
	// VolumeOperationAlreadyExists is message fmt returned to CO when there is another in-flight call on the given volumeID
	VolumeOperationAlreadyExists = "An operation with the given volume=%q is already in progress"
)
View Source
const (
	VolumeOperationAlreadyExistsErrorMsg = "An operation with the given Volume %s already exists"
)

Variables

This section is empty.

Functions

func GetNodeIP

func GetNodeIP(client kubernetes.Interface, nodeID string) (net.IP, error)

GetNodeIP get node address

func IsBlockDevice added in v0.3.0

func IsBlockDevice(fullPath string) (bool, error)

IsBlockDevice checks if the given path is a block device

Types

type CSIPlugin

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

func NewDriver

func NewDriver(driverName, nodeID, endpoint, sysPath string, grpcConnectionTimeout int) *CSIPlugin

func (*CSIPlugin) Run

func (plugin *CSIPlugin) Run()

type Idempotent added in v0.5.5

type Idempotent interface {
	// The CSI data types are generated using a protobuf.
	// The generated structures are guaranteed to implement the Stringer interface.
	// Example: https://github.com/container-storage-interface/spec/blob/master/lib/go/csi/csi.pb.go#L3508
	// We can use the generated string as the key of our internal inflight database of requests.
	String() string
}

Idempotent is the interface required to manage in flight requests.

type InFlight added in v0.5.5

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

InFlight is a struct used to manage in flight requests per volumeId.

func NewInFlight added in v0.5.5

func NewInFlight() *InFlight

NewInFlight instanciates a InFlight structures.

func (*InFlight) Delete added in v0.5.5

func (db *InFlight) Delete(key string)

Delete removes the entry from the inFlight entries map. It doesn't return anything, and will do nothing if the specified key doesn't exist.

func (*InFlight) Insert added in v0.5.5

func (db *InFlight) Insert(key string) bool

Insert inserts the entry to the current list of inflight request key is volumeId for node and req hash for controller . Returns false when the key already exists.

type Store added in v0.5.5

type Store interface {
	AddVolume(volumeID, device string) error
	DeleteVolume(volumeID string) error
	GetDevice(volumeID string) string
}

func NewVolumeStore added in v0.5.5

func NewVolumeStore(dataFilePath string) (Store, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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