Documentation ¶
Index ¶
- Constants
- Variables
- type Args
- type ControllerServer
- func (s *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (s *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (s *ControllerServer) ControllerGetVolume(ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (s *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (s *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (s *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (s *ControllerServer) CreateSnapshotOnNS(nsProvider ns.ProviderInterface, volumePath, snapName string) (snapshot ns.Snapshot, err error)
- func (s *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (res *csi.CreateVolumeResponse, err error)
- func (s *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (s *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (s *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (s *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (s *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (s *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type CreateMappingParams
- type Driver
- type ISCSIVolumeContext
- type IdentityServer
- func (ids *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (ids *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (ids *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- type NodeServer
- func (s *NodeServer) ConstructDevByPath(portal, iSCSITarget string, lunNumber int) (devByPath string)
- func (s *NodeServer) CreateISCSIMapping(params CreateMappingParams, nsProvider ns.ProviderInterface) error
- func (s *NodeServer) CreateNewTargetTg(parsedContext ISCSIVolumeContext, nsProvider ns.ProviderInterface) (target, targetGroup string, err error)
- func (s *NodeServer) CreateUpdateHostGroup(nsProvider ns.ProviderInterface) (name string, err error)
- func (s *NodeServer) DeviceFromTargetPath(volumePath string) (deviceName string, err error)
- func (s *NodeServer) FlushBufs(device string) (err error)
- func (s *NodeServer) GetMountPointPermissions(volumeContext map[string]string) (os.FileMode, error)
- func (s *NodeServer) GetNodeIQN() (initiatorName string, err error)
- func (s *NodeServer) GetRealDeviceName(symLink string) (string, error)
- func (s *NodeServer) ISCSILogInRescan(target, portal string) error
- func (s *NodeServer) IsBlockDevice(fullPath string) (bool, error)
- func (s *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (s *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (s *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (s *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (s *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (s *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (s *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (s *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (s *NodeServer) ParseVolumeContext(volumeContext map[string]string, nsProvider ns.ProviderInterface, ...) (parsedContext ISCSIVolumeContext, err error)
- func (s *NodeServer) RemoveDevice(devName string) error
- func (s *NodeServer) RescanDevice(devName string) error
- func (s *NodeServer) ResolveTargetGroup(parsedContext ISCSIVolumeContext, nsProvider ns.ProviderInterface) (target, targetGroup string, err error)
- func (s *NodeServer) SetChapAuth(name, chapUser, chapSecret string, nsProvider ns.ProviderInterface) (err error)
- type ResolveNSParams
- type ResolveNSResponse
- type Role
Constants ¶
const ( DefaultISCSITargetPrefix = "iqn.2005-07.com.nexenta" DefaultFsType = "ext4" DefaultISCSIPort = "3260" HostGroupPrefix = "csi" PathToInitiatorName = "/host/etc/iscsi/initiatorname.iscsi" DefaultNumOfLunsPerTarget = 256 DefaultUseChapAuth = false DefaultMountPointPermissions = 0750 DefaultFindMntTimeout = 90 DefaultISCSITimeout = 300 )
const DefaultSparseVolume = true
const TopologyKeyZone = "topology.kubernetes.io/zone"
Variables ¶
var Commit string
Commit - driver last commit, to set commit set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-csi-driver-block/pkg/driver.Commit=..."
var DateTime string
DateTime - driver build datetime, to set commit set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-csi-driver-block/pkg/driver.DateTime=..."
var Name = "nexentastor-block-csi-driver.nexenta.com"
Name - driver name
var Roles = []Role{RoleAll, RoleController, RoleNode}
Roles - list of the driver roles
var Version string
Version - driver version, to set version set flags: go build -ldflags "-X github.com/Nexenta/nexentastor-csi-driver-block/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 (s *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) ( *csi.ControllerExpandVolumeResponse, error, )
func (*ControllerServer) ControllerGetCapabilities ¶
func (s *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) ( *csi.ControllerGetCapabilitiesResponse, error, )
ControllerGetCapabilities - controller capabilities
func (*ControllerServer) ControllerGetVolume ¶ added in v1.4.11
func (s *ControllerServer) ControllerGetVolume( ctx context.Context, req *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error, )
func (*ControllerServer) ControllerPublishVolume ¶
func (s *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) ( *csi.ControllerPublishVolumeResponse, error, )
func (*ControllerServer) ControllerUnpublishVolume ¶
func (s *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) ( *csi.ControllerUnpublishVolumeResponse, error, )
func (*ControllerServer) CreateSnapshot ¶
func (s *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) ( *csi.CreateSnapshotResponse, error, )
CreateSnapshot creates a snapshot of given volume
func (*ControllerServer) CreateSnapshotOnNS ¶ added in v1.0.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 volume on NexentaStor
func (*ControllerServer) DeleteSnapshot ¶
func (s *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) ( *csi.DeleteSnapshotResponse, error, )
DeleteSnapshot deletes snapshots
func (*ControllerServer) DeleteVolume ¶
func (s *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) ( *csi.DeleteVolumeResponse, error, )
DeleteVolume - destroys volume on NexentaStor
func (*ControllerServer) GetCapacity ¶
func (s *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) ( *csi.GetCapacityResponse, error, )
func (*ControllerServer) ListSnapshots ¶
func (s *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) ( *csi.ListSnapshotsResponse, error, )
ListSnapshots returns the list of snapshots
func (*ControllerServer) ListVolumes ¶
func (s *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) ( *csi.ListVolumesResponse, error, )
ListVolumes - list volumes, shows only volumes created in defaultvolumeGroup
func (*ControllerServer) ValidateVolumeCapabilities ¶
func (s *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) ( *csi.ValidateVolumeCapabilitiesResponse, error, )
ValidateVolumeCapabilities validates volume capabilities Shall return confirmed only if all the volume capabilities specified in the request are supported.
type CreateMappingParams ¶ added in v1.0.0
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver - K8s CSI driver for NexentaStor
type ISCSIVolumeContext ¶ added in v1.4.4
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 ¶
func (ids *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) ( *csi.GetPluginCapabilitiesResponse, error, )
GetPluginCapabilities - get plugin capabilities
func (*IdentityServer) GetPluginInfo ¶
func (ids *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) ( *csi.GetPluginInfoResponse, error, )
GetPluginInfo - return plugin info
func (*IdentityServer) Probe ¶
func (ids *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
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) ConstructDevByPath ¶ added in v1.1.0
func (s *NodeServer) ConstructDevByPath(portal, iSCSITarget string, lunNumber int) (devByPath string)
func (*NodeServer) CreateISCSIMapping ¶ added in v1.0.0
func (s *NodeServer) CreateISCSIMapping(params CreateMappingParams, nsProvider ns.ProviderInterface) error
func (*NodeServer) CreateNewTargetTg ¶ added in v1.2.0
func (s *NodeServer) CreateNewTargetTg(parsedContext ISCSIVolumeContext, nsProvider ns.ProviderInterface) ( target, targetGroup string, err error, )
func (*NodeServer) CreateUpdateHostGroup ¶ added in v1.0.1
func (s *NodeServer) CreateUpdateHostGroup(nsProvider ns.ProviderInterface) (name string, err error)
func (*NodeServer) DeviceFromTargetPath ¶ added in v1.2.0
func (s *NodeServer) DeviceFromTargetPath(volumePath string) (deviceName string, err error)
func (*NodeServer) FlushBufs ¶ added in v1.4.8
func (s *NodeServer) FlushBufs(device string) (err error)
func (*NodeServer) GetMountPointPermissions ¶ added in v1.4.1
GetMountPointPermissions - check if mountPoint persmissions were set in config or use default
func (*NodeServer) GetNodeIQN ¶ added in v1.0.1
func (s *NodeServer) GetNodeIQN() (initiatorName string, err error)
func (*NodeServer) GetRealDeviceName ¶
func (s *NodeServer) GetRealDeviceName(symLink string) (string, error)
getRealDeviceName - get device name (e.g. /dev/sdb) from a symlink
func (*NodeServer) ISCSILogInRescan ¶
func (s *NodeServer) ISCSILogInRescan(target, portal string) error
ISCSILogInRescan - Attempts login to iSCSI target, rescan if already logged.
func (*NodeServer) IsBlockDevice ¶ added in v1.1.0
func (s *NodeServer) IsBlockDevice(fullPath string) (bool, error)
IsBlock checks if the given path is a block device
func (*NodeServer) NodeExpandVolume ¶
func (s *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) ( *csi.NodeExpandVolumeResponse, error, )
func (*NodeServer) NodeGetCapabilities ¶
func (s *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) ( *csi.NodeGetCapabilitiesResponse, error, )
NodeGetCapabilities - get node capabilities
func (*NodeServer) NodeGetInfo ¶
func (s *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo - get node info
func (*NodeServer) NodeGetVolumeStats ¶
func (s *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) ( *csi.NodeGetVolumeStatsResponse, error, )
NodeGetVolumeStats - volume stats (available capacity)
func (*NodeServer) NodePublishVolume ¶
func (s *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) ( *csi.NodePublishVolumeResponse, error, )
NodePublishVolume - mounts NS fs to the node
func (*NodeServer) NodeStageVolume ¶
func (s *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) ( *csi.NodeStageVolumeResponse, error, )
NodeStageVolume - stage volume
func (*NodeServer) NodeUnpublishVolume ¶
func (s *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) ( *csi.NodeUnpublishVolumeResponse, error, )
NodeUnpublishVolume - umount NS fs from the node and delete directory if successful
func (*NodeServer) NodeUnstageVolume ¶
func (s *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) ( *csi.NodeUnstageVolumeResponse, error, )
NodeUnstageVolume - unstage volume
func (*NodeServer) ParseVolumeContext ¶ added in v1.1.0
func (s *NodeServer) ParseVolumeContext( volumeContext map[string]string, nsProvider ns.ProviderInterface, configName string) ( parsedContext ISCSIVolumeContext, err error, )
func (*NodeServer) RemoveDevice ¶
func (s *NodeServer) RemoveDevice(devName string) error
RemoveDevice - remove device (e.g. /dev/sdb) after deleting LUN
func (*NodeServer) RescanDevice ¶ added in v1.3.0
func (s *NodeServer) RescanDevice(devName string) error
func (*NodeServer) ResolveTargetGroup ¶ added in v1.2.0
func (s *NodeServer) ResolveTargetGroup(parsedContext ISCSIVolumeContext, nsProvider ns.ProviderInterface) ( target, targetGroup string, err error, )
ResolveTargetGroup - find target with lowest lunmappings or create new one
func (*NodeServer) SetChapAuth ¶ added in v1.2.0
func (s *NodeServer) SetChapAuth(name, chapUser, chapSecret string, nsProvider ns.ProviderInterface) (err error)
type ResolveNSParams ¶
type ResolveNSParams struct {
// contains filtered or unexported fields
}
type ResolveNSResponse ¶
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 (Role) IsController ¶
IsController - is this a controller role