Documentation ¶
Overview ¶
Package node provides CSI specification compatible node service.
Index ¶
- type FcConnector
- type ISCSIConnector
- type NFSPublisher
- type NFSStager
- type NodeVolumePublisher
- type NodeVolumeStager
- type Opts
- type SCSIPublisher
- type SCSIStager
- type Service
- func (s *Service) Init() error
- func (s *Service) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (s *Service) NodeGetCapabilities(context context.Context, request *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (s *Service) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (s *Service) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (s *Service) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (s *Service) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (s *Service) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (s *Service) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
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 ¶
func (n *NFSStager) Stage(ctx context.Context, req *csi.NodeStageVolumeRequest, logFields log.Fields, fs fs.FsInterface, id string) (*csi.NodeStageVolumeResponse, error)
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 ¶
func (s *SCSIStager) Stage(ctx context.Context, req *csi.NodeStageVolumeRequest, logFields log.Fields, fs fs.FsInterface, id string) (*csi.NodeStageVolumeResponse, error)
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 ¶
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 ¶
func (s *Service) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
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 ¶
func (s *Service) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats returns volume usage stats
func (*Service) NodePublishVolume ¶
func (s *Service) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume publishes volume to the node by mounting it to the target path
func (*Service) NodeStageVolume ¶
func (s *Service) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume prepares volume to be consumed by node publish by connecting volume to the node
func (*Service) NodeUnpublishVolume ¶
func (s *Service) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unpublishes volume from the node by unmounting it from the target path
func (*Service) NodeUnstageVolume ¶
func (s *Service) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume reverses steps done in NodeStage by disconnecting volume from the node