node

package
v1.4.1 Latest Latest
Warning

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

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

Documentation

Overview

Package node provides CSI specification compatible node service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FcConnector

type FcConnector interface {
	ConnectVolume(ctx context.Context, info gobrick.FCVolumeInfo) (gobrick.Device, error)
	DisconnectVolumeByDeviceName(ctx context.Context, name string) error
	GetInitiatorPorts(ctx context.Context) ([]string, error)
}

FcConnector is wrapper of gobrcik.FcConnector interface. It allows to connect FC volumes to the node.

type ISCSIConnector

type ISCSIConnector interface {
	ConnectVolume(ctx context.Context, info gobrick.ISCSIVolumeInfo) (gobrick.Device, error)
	DisconnectVolumeByDeviceName(ctx context.Context, name string) error
	GetInitiatorName(ctx context.Context) ([]string, error)
}

ISCSIConnector is wrapper of gobrcik.ISCSIConnector interface. It allows to connect iSCSI volumes to the node.

type NFSPublisher

type NFSPublisher struct {
}

NFSPublisher implementation of NodeVolumePublisher for NFS volumes

func (*NFSPublisher) Publish

func (np *NFSPublisher) Publish(ctx context.Context, logFields log.Fields, fs fs.FsInterface,
	cap *csi.VolumeCapability, isRO bool, targetPath string, stagingPath string) (*csi.NodePublishVolumeResponse, error)

Publish publishes nfs volume by mounting it to the target path

type NFSStager

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

NFSStager implementation of NodeVolumeStager for NFS volumes

func (*NFSStager) Stage

Stage stages volume by mounting volumes as nfs to the staging path

type NodeVolumePublisher

type NodeVolumePublisher interface {
	Publish(ctx context.Context, logFields log.Fields, fs fs.FsInterface,
		cap *csi.VolumeCapability, isRO bool, targetPath string, stagingPath string) (*csi.NodePublishVolumeResponse, error)
}

NodeVolumePublisher allows to publish a volume

type NodeVolumeStager

type NodeVolumeStager interface {
	Stage(ctx context.Context, req *csi.NodeStageVolumeRequest, logFields log.Fields, fs fs.FsInterface, id string) (*csi.NodeStageVolumeResponse, error)
}

NodeVolumeStager allows to stage a volume

type Opts

type Opts struct {
	NodeIDFilePath        string
	NodeNamePrefix        string
	NodeChrootPath        string
	FCPortsFilterFilePath string
	KubeNodeName          string
	CHAPUsername          string
	CHAPPassword          string
	TmpDir                string
	EnableCHAP            bool
}

Opts defines service configuration options.

type SCSIPublisher

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

SCSIPublisher implementation of NodeVolumePublisher for SCSI based (FC, iSCSI) volumes

func (*SCSIPublisher) Publish

func (sp *SCSIPublisher) Publish(ctx context.Context, logFields log.Fields, fs fs.FsInterface, cap *csi.VolumeCapability, isRO bool, targetPath string, stagingPath string) (*csi.NodePublishVolumeResponse, error)

Publish publishes volume as either raw block or mount by mounting it to the target path

type SCSIStager

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

SCSIStager implementation of NodeVolumeStager for SCSI based (FC, iSCSI) volumes

func (*SCSIStager) Stage

Stage stages volume by connecting it through either FC or iSCSI and creating bind mount to staging path

type Service

type Service struct {
	Fs fs.FsInterface

	array.Locker
	// contains filtered or unexported fields
}

Service is a controller service that contains scsi connectors and implements NodeServer API

func (*Service) Init

func (s *Service) Init() error

Init initializes node service by parsing environmental variables, connecting it as a host. Will init ISCSIConnector, FcConnector and ControllerService if they are nil.

func (*Service) NodeExpandVolume

NodeExpandVolume expands the volume by re-scanning and resizes filesystem if needed

func (*Service) NodeGetCapabilities

func (s *Service) NodeGetCapabilities(context context.Context, request *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)

NodeGetCapabilities returns supported features by the node service

func (*Service) NodeGetInfo

func (s *Service) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)

NodeGetInfo returns id of the node and topology constraints

func (*Service) NodeGetVolumeStats

NodeGetVolumeStats returns volume usage stats

func (*Service) NodePublishVolume

NodePublishVolume publishes volume to the node by mounting it to the target path

func (*Service) NodeStageVolume

NodeStageVolume prepares volume to be consumed by node publish by connecting volume to the node

func (*Service) NodeUnpublishVolume

NodeUnpublishVolume unpublishes volume from the node by unmounting it from the target path

func (*Service) NodeUnstageVolume

NodeUnstageVolume reverses steps done in NodeStage by disconnecting volume from the node

Jump to

Keyboard shortcuts

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