driver

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMountPointPermissions = 0777
View Source
const TopologyKeyZone = "topology.kubernetes.io/zone"

Variables

View Source
var Commit string

Commit - driver last commit, to set commit set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-csi-driver/pkg/driver.Commit=..."

View Source
var DateTime string

DateTime - driver build datetime, to set commit set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-csi-driver/pkg/driver.DateTime=..."

View Source
var Name = "nexentastor-csi-driver.nexenta.com"

Name - driver name

Roles - list of the driver roles

View Source
var Version string

Version - driver version, to set version set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-csi-driver/pkg/driver.Version=0.0.1"

Functions

This section is empty.

Types

type Args

type Args struct {
	Role     Role
	NodeID   string
	Endpoint string
	Config   *config.Config
	Log      *logrus.Entry
}

Args - params to crete new driver

type ControllerServer

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

ControllerServer - k8s csi driver controller server

func NewControllerServer

func NewControllerServer(driver *Driver) (*ControllerServer, error)

NewControllerServer - create an instance of controller service

func (*ControllerServer) ControllerExpandVolume

func (*ControllerServer) ControllerGetCapabilities

ControllerGetCapabilities - controller capabilities

func (*ControllerServer) ControllerPublishVolume

ControllerPublishVolume - not supported

func (*ControllerServer) ControllerUnpublishVolume

ControllerUnpublishVolume - not supported

func (*ControllerServer) CreateSnapshot

CreateSnapshot creates a snapshot of given volume

func (*ControllerServer) CreateSnapshotOnNS added in v1.3.0

func (s *ControllerServer) CreateSnapshotOnNS(nsProvider ns.ProviderInterface, volumePath, snapName string) (
	snapshot ns.Snapshot, err error)

func (*ControllerServer) CreateVolume

func (s *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (
	res *csi.CreateVolumeResponse,
	err error,
)

CreateVolume - creates FS on NexentaStor

func (*ControllerServer) DeleteSnapshot

DeleteSnapshot deletes snapshots

func (*ControllerServer) DeleteVolume

DeleteVolume - destroys FS on NexentaStor

func (*ControllerServer) GetCapacity

func (*ControllerServer) ListSnapshots

ListSnapshots returns the list of snapshots

func (*ControllerServer) ListVolumes

ListVolumes - list volumes, shows only volumes created in defaultDataset TODO return only shared fs?

func (*ControllerServer) ValidateVolumeCapabilities

ValidateVolumeCapabilities validates volume capabilities Shall return confirmed only if all the volume capabilities specified in the request are supported.

type Driver

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

Driver - K8s CSI driver for NexentaStor

func NewDriver

func NewDriver(args Args) (*Driver, error)

NewDriver - new driver instance

func (*Driver) Run

func (d *Driver) Run() error

Run - run the driver

func (*Driver) Validate

func (d *Driver) Validate() error

Validate - validate driver configuration: - check NS connection - check NS license - in case of cluster, check if provided addresses belong to the same cluster

type IdentityServer

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

IdentityServer - k8s csi driver identity server

func NewIdentityServer

func NewIdentityServer(driver *Driver) *IdentityServer

NewIdentityServer - create an instance of identity server

func (*IdentityServer) GetPluginCapabilities

GetPluginCapabilities - get plugin capabilities

func (*IdentityServer) GetPluginInfo

GetPluginInfo - return plugin info

func (*IdentityServer) Probe

Probe - return driver status (ready or not)

type NodeServer

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

NodeServer - k8s csi driver node server

func NewNodeServer

func NewNodeServer(driver *Driver) (*NodeServer, error)

NewNodeServer - create an instance of node service

func (*NodeServer) GetMountPointPermissions added in v1.4.3

func (s *NodeServer) GetMountPointPermissions(volumeContext map[string]string) (os.FileMode, error)

GetMountPointPermissions - check if mountPoint persmissions were set in config or use default

func (*NodeServer) GetV13CompatibleConfigName added in v1.4.2

func (s *NodeServer) GetV13CompatibleConfigName() (string, error)

func (*NodeServer) NodeExpandVolume

NodeExpandVolume - not supported

func (*NodeServer) NodeGetCapabilities

NodeGetCapabilities - get node capabilities

func (*NodeServer) NodeGetInfo

NodeGetInfo - get node info

func (*NodeServer) NodeGetVolumeStats

NodeGetVolumeStats - volume stats (available capacity) TODO https://github.com/container-storage-interface/spec/blob/master/spec.md#nodegetvolumestats

func (*NodeServer) NodePublishVolume

NodePublishVolume - mounts NS fs to the node

func (*NodeServer) NodeStageVolume

NodeStageVolume - stage volume TODO use this to mount NFS, then do bind mount?

func (*NodeServer) NodeUnpublishVolume

NodeUnpublishVolume - umount NS fs from the node and delete directory if successful

func (*NodeServer) NodeUnstageVolume

NodeUnstageVolume - unstage volume TODO use this to umount NFS?

type ResolveNSParams added in v1.4.0

type ResolveNSParams struct {
	IsV13Compatible bool
	// contains filtered or unexported fields
}

type ResolveNSResponse added in v1.4.0

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

type Role

type Role string

Role - role of this instance of driver

const (
	// RoleAll - run driver as both controller and node instance
	RoleAll Role = "all"

	// RoleController - run driver as a controller instance (Identity server + Controller server)
	// This role should be used with:
	// 	- "csi-provisioner" sidecar container that watches Kubernetes PersistentVolumeClaim objects
	//		and triggers CreateVolume/DeleteVolume against a CSI endpoint
	//	- "csi-attacher" sidecar container that watches Kubernetes VolumeAttachment objects
	// 		and triggers ControllerPublish/Unpublish against a CSI endpoint
	RoleController Role = "controller"

	// RoleNode - to run driver as a node instance (Identity server + Node server), runs on each K8s node
	// This role should be used with "driver-registrar", sidecar container that:
	//	1) registers the CSI driver with kubelet
	//	2) adds the drivers custom NodeId to a label on the Kubernetes Node API Object
	RoleNode Role = "node"
)

func ParseRole

func ParseRole(from string) (Role, error)

ParseRole - create role from user input

func (Role) IsController

func (r Role) IsController() bool

IsController - is this a controller role

func (Role) IsNode

func (r Role) IsNode() bool

IsNode - is this a node role

func (Role) String

func (r Role) String() string

type VolumeInfo added in v1.4.2

type VolumeInfo struct {
	ConfigName           string
	Path                 string
	IsV13VolumeIDVersion bool
}

func ParseVolumeID added in v1.4.2

func ParseVolumeID(volumeID string) (VolumeInfo, error)

Jump to

Keyboard shortcuts

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