hostpath

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 31 Imported by: 0

README

CSI Hostpath driver

Usage:

Build hostpathplugin
$ make
Start Hostpath driver
$ sudo ./bin/hostpathplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5
Test using csc

Get csc tool from https://github.com/rexray/gocsi/tree/master/csc

Get plugin info
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"csi-hostpath"  "0.1.0"
Create a volume
$ csc controller new --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeName
CSIVolumeID
Delete a volume
$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
CSIVolumeID
Validate volume capabilities
$ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID
CSIVolumeID  true
NodePublish a volume
$ csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
NodeUnpublish a volume
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
Get NodeInfo
$ csc node get-info --endpoint tcp://127.0.0.1:10000
CSINode

Documentation

Index

Constants

View Source
const TopologyKeyNode = "topology.hostpath.csi/node"

Variables

This section is empty.

Functions

func NewHostPathDriver

func NewHostPathDriver(driverName, nodeID, endpoint string, ephemeral bool, maxVolumesPerNode int64, version string, capacity Capacity) (*hostPath, error)

func NewNonBlockingGRPCServer

func NewNonBlockingGRPCServer() *nonBlockingGRPCServer

Types

type Capacity added in v1.6.0

type Capacity map[string]resource.Quantity

Capacity simulates linear storage of certain types ("fast", "slow"). When volumes of those types get created, they must allocate storage (which can fail!) and that storage must be freed again when volumes get destroyed.

Available capacity is configurable with a command line flag -capacity <type>=<size> where <type> is a string and <size> is a quantity (1T, 1Gi). More than one of those flags can be used.

func (Capacity) Alloc added in v1.6.0

func (c Capacity) Alloc(kind string, size int64) (actualKind string, err error)

Alloc reserves a certain amount of bytes. Errors are usable as result of gRPC calls. Empty kind means that any large enough one is fine.

func (Capacity) Check added in v1.6.0

func (c Capacity) Check(kind string) resource.Quantity

Check reports available capacity for a certain kind. If empty, it reports the maximum capacity.

func (Capacity) Enabled added in v1.6.0

func (c Capacity) Enabled() bool

Enabled returns true if capacities are configured.

func (Capacity) Free added in v1.6.0

func (c Capacity) Free(kind string, size int64)

Free returns capacity reserved earlier with Alloc.

func (Capacity) Set added in v1.6.0

func (c Capacity) Set(arg string) error

Set is an implementation of flag.Value.Set.

func (Capacity) String added in v1.6.0

func (c Capacity) String() string

type ContainerFileSystem added in v1.5.0

type ContainerFileSystem struct {
	Children []MountPointInfo `json:"children"`
}

type FileSystems added in v1.5.0

type FileSystems struct {
	Filsystem []ContainerFileSystem `json:"filesystems"`
}

type MountPointInfo added in v1.5.0

type MountPointInfo struct {
	Target              string           `json:"target"`
	Source              string           `json:"source"`
	FsType              string           `json:"fstype"`
	Options             string           `json:"options"`
	ContainerFileSystem []MountPointInfo `json:"children,omitempty"`
}

Jump to

Keyboard shortcuts

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