hostpath

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 32 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(cfg Config) (*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"). To calculate the amount of allocated space, the size of all currently existing volumes of the same kind is summed up.

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.

The underlying map will be initialized if needed by Set, which makes it possible to define and use a Capacity instance without explicit initialization (`var capacity Capacity` or as member in a struct).

func (*Capacity) Enabled added in v1.6.0

func (c *Capacity) Enabled() bool

Enabled returns true if capacities are configured.

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 Config added in v1.7.0

type Config struct {
	DriverName            string
	Endpoint              string
	ProxyEndpoint         string
	NodeID                string
	VendorVersion         string
	StateDir              string
	MaxVolumesPerNode     int64
	MaxVolumeSize         int64
	AttachLimit           int64
	Capacity              Capacity
	Ephemeral             bool
	ShowVersion           bool
	EnableAttach          bool
	EnableTopology        bool
	EnableVolumeExpansion bool
	CheckVolumeLifecycle  bool
}

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