Documentation
¶
Index ¶
- Constants
- func ParseEndpoint(ep string) (string, string, error)
- type Attacher
- type AttacherImpl
- func (i *AttacherImpl) Discover(ip, initiator string) error
- func (i *AttacherImpl) GetDevice(portal, target string) (string, error)
- func (i *AttacherImpl) GetScsiID(devicePath string) (string, error)
- func (i *AttacherImpl) HasSession(ip, target string) (bool, error)
- func (i *AttacherImpl) Login(ip, target string) error
- func (i *AttacherImpl) Logout(ip, target string) error
- func (i *AttacherImpl) MultipathReadBindings() (map[string]string, map[string]string, error)
- func (i *AttacherImpl) MultipathWriteBindings(bindings map[string]string) error
- type BlockInfo
- type Deviceset
- type Initializer
- type InitializerImpl
- type Mounter
- type MounterImpl
- func (m *MounterImpl) Bindmount(src, target string) error
- func (m *MounterImpl) FormatMappedDevice(device string) error
- func (m *MounterImpl) GetMappedDevice(device string) (BlockInfo, error)
- func (m *MounterImpl) MountMappedDevice(device, target string) error
- func (m *MounterImpl) Unmount(path string) error
- type NonBlockingGRPCServer
- type PacketControllerServer
- func (controller *PacketControllerServer) ControllerExpandVolume(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (controller *PacketControllerServer) ControllerGetCapabilities(ctx context.Context, in *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (controller *PacketControllerServer) ControllerPublishVolume(ctx context.Context, in *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (controller *PacketControllerServer) ControllerUnpublishVolume(ctx context.Context, in *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (controller *PacketControllerServer) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (controller *PacketControllerServer) CreateVolume(ctx context.Context, in *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (controller *PacketControllerServer) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (controller *PacketControllerServer) DeleteVolume(ctx context.Context, in *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (controller *PacketControllerServer) GetCapacity(ctx context.Context, in *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (controller *PacketControllerServer) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (controller *PacketControllerServer) ListVolumes(ctx context.Context, in *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (controller *PacketControllerServer) ValidateVolumeCapabilities(ctx context.Context, in *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type PacketDriver
- type PacketIdentityServer
- func (packetIdentity *PacketIdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (packetIdentity *PacketIdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (packetIdentity *PacketIdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- type PacketNodeServer
- func (nodeServer *PacketNodeServer) NodeExpandVolume(context.Context, *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (nodeServer *PacketNodeServer) NodeGetCapabilities(ctx context.Context, in *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (nodeServer *PacketNodeServer) NodeGetInfo(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (nodeServer *PacketNodeServer) NodeGetVolumeStats(ctx context.Context, in *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (nodeServer *PacketNodeServer) NodePublishVolume(ctx context.Context, in *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (nodeServer *PacketNodeServer) NodeStageVolume(ctx context.Context, in *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (nodeServer *PacketNodeServer) NodeUnpublishVolume(ctx context.Context, in *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (nodeServer *PacketNodeServer) NodeUnstageVolume(ctx context.Context, in *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
Constants ¶
const ( // VolumeMaxRetries maximum number of times to retry until giving up on a volume create request VolumeMaxRetries = 10 // VolumeRetryInterval retry interval in seconds between retries to check if a volume create request is ready VolumeRetryInterval = 1 // in seconds // AttachMaxRetries maximum number of times to retry until giving up on a volume attach request AttachMaxRetries = 5 // AttachRetryInterval retry interval in seconds between retries to check if a volume attachment is ready AttachRetryInterval = 1 // in seconds // DetachMaxRetries maximum number of times to retry until giving up on a volume detach request DetachMaxRetries = 30 // AttachRetryInterval retry interval in seconds between retries to check if a volume is detached DetachRetryInterval = 2 // in seconds )
const (
DriverName = "net.packet.csi"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Attacher ¶ added in v1.0.0
type Attacher interface { // Discover also sets up the iface, so it requires the initiator Discover(ip, initiator string) error HasSession(ip, targe string) (bool, error) Login(ip, target string) error Logout(ip, target string) error // these check locally on the local host GetScsiID(devicePath string) (string, error) GetDevice(portal, target string) (string, error) // these do multipath MultipathReadBindings() (map[string]string, map[string]string, error) MultipathWriteBindings(map[string]string) error }
IscsiAdm interface provides methods of executing iscsi admin commands
type AttacherImpl ¶ added in v1.0.0
type AttacherImpl struct { }
func (*AttacherImpl) Discover ¶ added in v1.0.0
func (i *AttacherImpl) Discover(ip, initiator string) error
func (*AttacherImpl) GetDevice ¶ added in v1.0.0
func (i *AttacherImpl) GetDevice(portal, target string) (string, error)
look for file that matches portal, target, look up what it links to
func (*AttacherImpl) GetScsiID ¶ added in v1.0.0
func (i *AttacherImpl) GetScsiID(devicePath string) (string, error)
func (*AttacherImpl) HasSession ¶ added in v1.0.0
func (i *AttacherImpl) HasSession(ip, target string) (bool, error)
HasSession checks to see if the session exists, may log an extraneous error if the seesion does not exist
func (*AttacherImpl) Login ¶ added in v1.0.0
func (i *AttacherImpl) Login(ip, target string) error
func (*AttacherImpl) Logout ¶ added in v1.0.0
func (i *AttacherImpl) Logout(ip, target string) error
func (*AttacherImpl) MultipathReadBindings ¶ added in v1.0.0
read the bindings from /etc/multipath/bindings separating into keep/discard sets return elements map from volume name to scsi id
func (*AttacherImpl) MultipathWriteBindings ¶ added in v1.0.0
func (i *AttacherImpl) MultipathWriteBindings(bindings map[string]string) error
write the bindings to /etc/multipath/bindings
type BlockInfo ¶ added in v1.0.0
type BlockInfo struct { Name string `json:"name"` FsType string `json:"fstype"` Label string `json:"label"` UUID string `json:"uuid"` Mountpoint string `json:"mountpoint"` }
represents the lsblk info
type Deviceset ¶ added in v1.0.0
type Deviceset struct {
BlockDevices []BlockInfo `json:"blockdevices"`
}
represents the lsblk info
type Initializer ¶ added in v1.0.0
type InitializerImpl ¶ added in v1.0.0
type InitializerImpl struct { }
func (*InitializerImpl) ConfigureMultipath ¶ added in v1.0.0
func (n *InitializerImpl) ConfigureMultipath() error
func (*InitializerImpl) NodeInit ¶ added in v1.0.0
func (n *InitializerImpl) NodeInit(initiatorName string) error
NodeInit does all node initialization necessary for iscsi to be configured correctly
func (*InitializerImpl) RestartServices ¶ added in v1.0.0
func (n *InitializerImpl) RestartServices() error
RestartServices should restart services, but we have no way to do that yet
func (*InitializerImpl) SetIscsiInitiator ¶ added in v1.0.0
func (n *InitializerImpl) SetIscsiInitiator(initiatorName string) error
SetIscsiInitiator sets the name of the iscsi initiator
type MounterImpl ¶ added in v1.0.0
type MounterImpl struct { }
func (*MounterImpl) Bindmount ¶ added in v1.0.0
func (m *MounterImpl) Bindmount(src, target string) error
func (*MounterImpl) FormatMappedDevice ¶ added in v1.0.0
func (m *MounterImpl) FormatMappedDevice(device string) error
ext4 format
func (*MounterImpl) GetMappedDevice ¶ added in v1.0.0
func (m *MounterImpl) GetMappedDevice(device string) (BlockInfo, error)
get info
func (*MounterImpl) MountMappedDevice ¶ added in v1.0.0
func (m *MounterImpl) MountMappedDevice(device, target string) error
func (*MounterImpl) Unmount ¶ added in v1.0.0
func (m *MounterImpl) Unmount(path string) error
type NonBlockingGRPCServer ¶
type NonBlockingGRPCServer interface { // Start services at the endpoint Start(endpoint string, ids csi.IdentityServer, cs csi.ControllerServer, ns csi.NodeServer) // Waits for the service to stop Wait() // Stops the service gracefully Stop() // Stops the service forcefully ForceStop() }
NonBlockingGRPCServer Defines Non blocking GRPC server interfaces
func NewNonBlockingGRPCServer ¶
func NewNonBlockingGRPCServer() NonBlockingGRPCServer
NewNonBlockingGRPCServer create a new NonBlockingGRPCServer
type PacketControllerServer ¶
type PacketControllerServer struct {
Provider packet.VolumeProvider
}
PacketControllerServer controller server to manage CSI
func NewPacketControllerServer ¶
func NewPacketControllerServer(provider packet.VolumeProvider) *PacketControllerServer
NewPacketControllerServer create new PacketControllerServer with the given provider
func (*PacketControllerServer) ControllerExpandVolume ¶ added in v1.0.0
func (controller *PacketControllerServer) ControllerExpandVolume(context.Context, *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume expand a volume
func (*PacketControllerServer) ControllerGetCapabilities ¶
func (controller *PacketControllerServer) ControllerGetCapabilities(ctx context.Context, in *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities get capabilities of the controller
func (*PacketControllerServer) ControllerPublishVolume ¶
func (controller *PacketControllerServer) ControllerPublishVolume(ctx context.Context, in *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume attaches a volume to a node
func (*PacketControllerServer) ControllerUnpublishVolume ¶
func (controller *PacketControllerServer) ControllerUnpublishVolume(ctx context.Context, in *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume detaches a volume from a node
func (*PacketControllerServer) CreateSnapshot ¶
func (controller *PacketControllerServer) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
CreateSnapshot snapshot a single volume
func (*PacketControllerServer) CreateVolume ¶
func (controller *PacketControllerServer) CreateVolume(ctx context.Context, in *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume create a volume in the given context according to https://kubernetes-csi.github.io/docs/external-provisioner.html this should return when the volume is successfully provisioned or fails csi contains no provision for returning from a volume creation *request* and then checking later thus, we must either succeed or fail before returning from this function call
func (*PacketControllerServer) DeleteSnapshot ¶
func (controller *PacketControllerServer) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot delete an existing snapshot
func (*PacketControllerServer) DeleteVolume ¶
func (controller *PacketControllerServer) DeleteVolume(ctx context.Context, in *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume delete the specific volume
func (*PacketControllerServer) GetCapacity ¶
func (controller *PacketControllerServer) GetCapacity(ctx context.Context, in *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity get the available capacity
func (*PacketControllerServer) ListSnapshots ¶
func (controller *PacketControllerServer) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots list known snapshots
func (*PacketControllerServer) ListVolumes ¶
func (controller *PacketControllerServer) ListVolumes(ctx context.Context, in *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes list known volumes
func (*PacketControllerServer) ValidateVolumeCapabilities ¶
func (controller *PacketControllerServer) ValidateVolumeCapabilities(ctx context.Context, in *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities validate that a given volume has the require capabilities
type PacketDriver ¶
type PacketDriver struct { Logger *log.Entry Attacher Attacher Mounter Mounter Initializer Initializer // contains filtered or unexported fields }
PacketDriver driver for packet cloud
func NewPacketDriver ¶
func NewPacketDriver(endpoint, nodeID string, config packet.Config) (*PacketDriver, error)
NewPacketDriver create a new PacketDriver
type PacketIdentityServer ¶
type PacketIdentityServer struct {
Driver *PacketDriver
}
PacketIdentityServer represent the identity server for Packet
func NewPacketIdentityServer ¶
func NewPacketIdentityServer(driver *PacketDriver) *PacketIdentityServer
NewPacketIdentityServer create a new PacketIdentityServer
func (*PacketIdentityServer) GetPluginCapabilities ¶
func (packetIdentity *PacketIdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities get capabilities of the plugin
func (*PacketIdentityServer) GetPluginInfo ¶
func (packetIdentity *PacketIdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo get information about the plugin
func (*PacketIdentityServer) Probe ¶
func (packetIdentity *PacketIdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe probe the identity server
type PacketNodeServer ¶
type PacketNodeServer struct { Driver *PacketDriver MetadataDriver *packet.MetadataDriver Initialized bool // contains filtered or unexported fields }
PacketNodeServer represents a packet node
func NewPacketNodeServer ¶
func NewPacketNodeServer(driver *PacketDriver, metadata *packet.MetadataDriver) (*PacketNodeServer, error)
NewPacketNodeServer create a new PacketNodeServer
func (*PacketNodeServer) NodeExpandVolume ¶ added in v1.0.0
func (nodeServer *PacketNodeServer) NodeExpandVolume(context.Context, *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume expand a volume
func (*PacketNodeServer) NodeGetCapabilities ¶
func (nodeServer *PacketNodeServer) NodeGetCapabilities(ctx context.Context, in *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities get capabilities of a given node
func (*PacketNodeServer) NodeGetInfo ¶
func (nodeServer *PacketNodeServer) NodeGetInfo(context.Context, *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo get info for a given node
func (*PacketNodeServer) NodeGetVolumeStats ¶ added in v1.0.0
func (nodeServer *PacketNodeServer) NodeGetVolumeStats(ctx context.Context, in *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats gets the usage stats of the volume
func (*PacketNodeServer) NodePublishVolume ¶
func (nodeServer *PacketNodeServer) NodePublishVolume(ctx context.Context, in *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume ~ mount
func (*PacketNodeServer) NodeStageVolume ¶
func (nodeServer *PacketNodeServer) NodeStageVolume(ctx context.Context, in *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume ~ iscisadmin, multipath, format
func (*PacketNodeServer) NodeUnpublishVolume ¶
func (nodeServer *PacketNodeServer) NodeUnpublishVolume(ctx context.Context, in *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume ~ unmount
func (*PacketNodeServer) NodeUnstageVolume ¶
func (nodeServer *PacketNodeServer) NodeUnstageVolume(ctx context.Context, in *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume ~ iscisadmin, multipath