Documentation
¶
Index ¶
- Constants
- func ControllerServiceCapabilities() []*csi.ControllerServiceCapability
- func NodeServiceCapabilities() []*csi.NodeServiceCapability
- func VolumeCapabilityAccessModes() []*csi.VolumeCapability_AccessMode
- type Command
- type ControllerServer
- func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type Encryption
- type Executor
- type IdentityServer
- func (linodeIdentity *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (linodeIdentity *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (linodeIdentity *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- type LinodeDriver
- func (linodeDriver *LinodeDriver) Run(ctx context.Context, endpoint string)
- func (linodeDriver *LinodeDriver) SetupLinodeDriver(ctx context.Context, linodeClient linodeclient.LinodeClient, ...) error
- func (linodeDriver *LinodeDriver) ValidateControllerServiceRequest(ctx context.Context, c csi.ControllerServiceCapability_RPC_Type) error
- type LuksContext
- type Metadata
- type Mounter
- type NodeServer
- func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (ns *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (ns *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- type NonBlockingGRPCServer
- type VolumeLifecycle
Constants ¶
const ( // WaitTimeout is the default timeout duration used for polling the Linode // API, when waiting for a volume to enter an "active" state. WaitTimeout = 5 * time.Minute // CloneTimeout is the duration to wait when cloning a volume through the // Linode API. CloneTimeout = 15 * time.Minute )
const ( // VolumeTags is the parameter key used for passing a comma-separated list // of tags to the Linode API. VolumeTags = Name + "/volumeTags" // PublishInfoVolumeName is used to pass the name of the volume as it exists // in the Linode API (the "label") to [NodeStageVolume] and // [NodePublishVolume]. PublishInfoVolumeName = Name + "/volume-name" // VolumeTopologyRegion is the parameter key used to indicate the region // the volume exists in. VolumeTopologyRegion string = "topology.linode.com/region" )
const ( // LuksEncryptedAttribute is used to pass the information if the volume should be // encrypted with luks to `NodeStageVolume` LuksEncryptedAttribute = Name + "/luks-encrypted" // LuksCipherAttribute is used to pass the information about the luks encryption // cipher to `NodeStageVolume` LuksCipherAttribute = Name + "/luks-cipher" // LuksKeySizeAttribute is used to pass the information about the luks key size // to `NodeStageVolume` LuksKeySizeAttribute = Name + "/luks-key-size" // LuksKeyAttribute is the key of the luks key used in the map of secrets passed from the CO LuksKeyAttribute = "luksKey" )
const LinodeIDPath = "/linode-info/linode-id"
LinodeIDPath is the path to a file containing only the ID of the Linode instance the CSI node plugin is currently running on. This file is expected to be placed into the Linode by the init container provided with the CSI node plugin.
const MaxVolumeLabelPrefixLength = 12
MaxVolumeLabelPrefixLength is the maximum allowed length of a volume label prefix.
const MinVolumeSizeBytes = 10 << 30 // 10GiB
MinVolumeSizeBytes is the smallest allowed size for a Linode block storage Volume, in bytes.
The CSI RPC scheme deal with bytes, whereas the Linode API's block storage volume endpoints deal with "GB". Internally, the driver will deal with sizes and capacities in bytes, but convert to and from "GB" when interacting with the Linode API.
const Name = "linodebs.csi.linode.com"
Name is the name of the driver provided by this package. It is also used as the name of the socket file used for container orchestrator and driver communications.
Variables ¶
This section is empty.
Functions ¶
func ControllerServiceCapabilities ¶
func ControllerServiceCapabilities() []*csi.ControllerServiceCapability
ControllerServiceCapabilities returns the list of capabilities supported by this driver's controller service.
func NodeServiceCapabilities ¶
func NodeServiceCapabilities() []*csi.NodeServiceCapability
NodeServiceCapabilities returns the list of capabilities supported by this driver's node service.
func VolumeCapabilityAccessModes ¶
func VolumeCapabilityAccessModes() []*csi.VolumeCapability_AccessMode
VolumeCapabilityAccessModes returns the allowed access modes for a volume created by the driver.
Types ¶
type ControllerServer ¶ added in v0.8.4
type ControllerServer struct {
csi.UnimplementedControllerServer
// contains filtered or unexported fields
}
func NewControllerServer ¶
func NewControllerServer(ctx context.Context, driver *LinodeDriver, client linodeclient.LinodeClient, metadata Metadata) (*ControllerServer, error)
NewControllerServer instantiates a new RPC service that implements the CSI Controller Service RPC endpoints.
If driver or client are nil, NewControllerServer returns a non-nil error.
func (*ControllerServer) ControllerExpandVolume ¶ added in v0.8.4
func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
func (*ControllerServer) ControllerGetCapabilities ¶ added in v0.8.4
func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the supported capabilities of controller service provided by this Plugin
func (*ControllerServer) ControllerPublishVolume ¶ added in v0.8.4
func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume attaches the given volume to the node
func (*ControllerServer) ControllerUnpublishVolume ¶ added in v0.8.4
func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume deattaches the given volume from the node
func (*ControllerServer) CreateVolume ¶ added in v0.8.4
func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume will be called by the CO to provision a new volume on behalf of a user (to be consumed as either a block device or a mounted filesystem). This operation is idempotent.
func (*ControllerServer) DeleteVolume ¶ added in v0.8.4
func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume deletes the given volume. The function is idempotent.
func (*ControllerServer) ListVolumes ¶ added in v0.8.4
func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes shall return information about all the volumes the provider knows about
func (*ControllerServer) ValidateVolumeCapabilities ¶ added in v0.8.4
func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities checks whether the volume capabilities requested are supported.
type Encryption ¶ added in v0.8.4
type Encryption struct {
Exec Executor
FileSystem mountmanager.FileSystem
}
func NewLuksEncryption ¶ added in v0.8.4
func NewLuksEncryption(executor utilexec.Interface, fileSystem mountmanager.FileSystem) Encryption
type IdentityServer ¶ added in v0.8.4
type IdentityServer struct {
csi.UnimplementedIdentityServer
// contains filtered or unexported fields
}
IdentityServer implements the CSI Identity service for the Linode Block Storage CSI Driver.
func NewIdentityServer ¶
func NewIdentityServer(ctx context.Context, linodeDriver *LinodeDriver) (*IdentityServer, error)
NewIdentityServer creates and initializes a new IdentityServer. It takes a context and a LinodeDriver as input and returns a pointer to IdentityServer and an error.
func (*IdentityServer) GetPluginCapabilities ¶ added in v0.8.4
func (linodeIdentity *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns the capabilities of the CSI plugin. This method is REQUIRED for the Identity service as per the CSI spec. It informs the CO of the supported features by this plugin.
func (*IdentityServer) GetPluginInfo ¶ added in v0.8.4
func (linodeIdentity *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo returns information about the CSI plugin. This method is REQUIRED for the Identity service as per the CSI spec. It returns the name and version of the CSI plugin.
func (*IdentityServer) Probe ¶ added in v0.8.4
func (linodeIdentity *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe checks if the plugin is ready to serve requests. This method is REQUIRED for the Identity service as per the CSI spec. It allows the CO to check the readiness of the plugin.
type LinodeDriver ¶
type LinodeDriver struct {
// contains filtered or unexported fields
}
func GetLinodeDriver ¶
func GetLinodeDriver(ctx context.Context) *LinodeDriver
func (*LinodeDriver) Run ¶
func (linodeDriver *LinodeDriver) Run(ctx context.Context, endpoint string)
func (*LinodeDriver) SetupLinodeDriver ¶
func (linodeDriver *LinodeDriver) SetupLinodeDriver( ctx context.Context, linodeClient linodeclient.LinodeClient, mounter *mount.SafeFormatAndMount, deviceUtils mountmanager.DeviceUtils, metadata Metadata, name, vendorVersion, volumeLabelPrefix string, encrypt Encryption, ) error
func (*LinodeDriver) ValidateControllerServiceRequest ¶
func (linodeDriver *LinodeDriver) ValidateControllerServiceRequest(ctx context.Context, c csi.ControllerServiceCapability_RPC_Type) error
type LuksContext ¶
type Metadata ¶
type Metadata struct {
ID int // Instance ID.
Label string // The label assigned to the instance.
Region string // Region the instance is running in.
Memory uint // Amount of memory the instance has, in bytes.
}
Metadata contains metadata about the node/instance the CSI node plugin is running on.
func GetMetadata ¶
GetMetadata retrieves information about the current node/instance from the Linode Metadata Service. If the Metadata Service is unavailable, or this function otherwise returns a non-nil error, callers should call GetMetadataFromAPI.
type NodeServer ¶ added in v0.8.4
type NodeServer struct {
csi.UnimplementedNodeServer
// contains filtered or unexported fields
}
func NewNodeServer ¶
func NewNodeServer(ctx context.Context, linodeDriver *LinodeDriver, mounter *mount.SafeFormatAndMount, deviceUtils mountmanager.DeviceUtils, client linodeclient.LinodeClient, metadata Metadata, encrypt Encryption) (*NodeServer, error)
func (*NodeServer) NodeExpandVolume ¶ added in v0.8.4
func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
func (*NodeServer) NodeGetCapabilities ¶ added in v0.8.4
func (ns *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
func (*NodeServer) NodeGetInfo ¶ added in v0.8.4
func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
func (*NodeServer) NodeGetVolumeStats ¶ added in v0.8.4
func (ns *NodeServer) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
func (*NodeServer) NodePublishVolume ¶ added in v0.8.4
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
func (*NodeServer) NodeStageVolume ¶ added in v0.8.4
func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
func (*NodeServer) NodeUnpublishVolume ¶ added in v0.8.4
func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
func (*NodeServer) NodeUnstageVolume ¶ added in v0.8.4
func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, 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()
}
Defines Non blocking GRPC server interfaces
func NewNonBlockingGRPCServer ¶
func NewNonBlockingGRPCServer() NonBlockingGRPCServer
type VolumeLifecycle ¶
type VolumeLifecycle string
VolumeLifecycle is a type used to indicate the phase a volume is at when it is published and/or staged to a node.
const ( VolumeLifecycleNodeStageVolume VolumeLifecycle = "NodeStageVolume" VolumeLifecycleNodePublishVolume VolumeLifecycle = "NodePublishVolume" VolumeLifecycleNodeUnstageVolume VolumeLifecycle = "NodeUnstageVolume" VolumeLifecycleNodeUnpublishVolume VolumeLifecycle = "NodeUnpublishVolume" )