Documentation ¶
Overview ¶
Package node provides CSI specification compatible node service.
Index ¶
- Variables
- func MarshalSyncMapToJSON(m *sync.Map) ([]byte, error)
- type FcConnector
- type ISCSIConnector
- type NFSPublisher
- type NFSStager
- type NFSv4ACLs
- type NFSv4ACLsInterface
- type NVMEConnector
- 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, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (s *Service) NodeGetInfo(ctx context.Context, _ *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)
- type VolumePublisher
- type VolumeStager
Constants ¶
This section is empty.
Variables ¶
var ReachableEndPoint = common.ReachableEndPoint
ReachableEndPoint checks if the endpoint is reachable or not
Functions ¶
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.Interface, 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
type NFSv4ACLsInterface ¶
type NFSv4ACLsInterface interface { // SetNfsv4Acls sets NFSv4 ACLs SetNfsv4Acls(acls string, dir string) error }
NFSv4ACLsInterface contains method definition to set NFSv4 ACLs
type NVMEConnector ¶
type NVMEConnector interface { ConnectVolume(ctx context.Context, info gobrick.NVMeVolumeInfo, useFC bool) (gobrick.Device, error) DisconnectVolumeByDeviceName(ctx context.Context, name string) error GetInitiatorName(ctx context.Context) ([]string, error) }
NVMEConnector is wrapper of gobrick.NVMEConnector interface. It allows to connect NVMe volumes to the node.
type Opts ¶
type Opts struct { NodeIDFilePath string NodeNamePrefix string NodeChrootPath string MaxVolumesPerNode int64 FCPortsFilterFilePath string KubeNodeName string KubeConfigPath 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.Interface, 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.Interface, id string, isRemote bool, ) (*csi.NodeStageVolumeResponse, error)
Stage stages volume by connecting it through either FC or iSCSI and creating bind mount to staging path
type Service ¶
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, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities returns supported features by the node service
func (*Service) NodeGetInfo ¶
func (s *Service) NodeGetInfo(ctx context.Context, _ *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
type VolumePublisher ¶
type VolumePublisher interface { Publish(ctx context.Context, logFields log.Fields, fs fs.Interface, cap *csi.VolumeCapability, isRO bool, targetPath string, stagingPath string) (*csi.NodePublishVolumeResponse, error) }
VolumePublisher allows to node publish a volume
type VolumeStager ¶
type VolumeStager interface {
Stage(ctx context.Context, req *csi.NodeStageVolumeRequest, logFields log.Fields, fs fs.Interface, id string, isRemote bool) (*csi.NodeStageVolumeResponse, error)
}
VolumeStager allows to node stage a volume