Documentation ¶
Index ¶
- Constants
- type Configuration
- 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) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerServer) CreateVolumeBlockStorage(ctx context.Context, req *csi.CreateVolumeRequest, size int) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerServer) CreateVolumeNetworkStorage(ctx context.Context, req *csi.CreateVolumeRequest, size int) (*csi.CreateVolumeResponse, error)
- func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerServer) DeleteVolumeBlockStorage(ctx context.Context, req *csi.DeleteVolumeRequest, id string) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerServer) DeleteVolumeNetworkStorage(ctx context.Context, req *csi.DeleteVolumeRequest, id string) (*csi.DeleteVolumeResponse, error)
- func (cs *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (cs *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, 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 Driver
- type IdentityServer
- func (is *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (is *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (is *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- type NetworkStorage
- func (ns *NetworkStorage) CreateFile(sftpClient *sftp.Client, filePath string, fileContents *bytes.Buffer) error
- func (ns *NetworkStorage) CreateSFTPClient(sshClient *ssh.Client) (*sftp.Client, error)
- func (ns *NetworkStorage) CreateSSHClient() (*ssh.Client, error)
- func (ns *NetworkStorage) CreateSSHSession(sshClient *ssh.Client) (*ssh.Session, error)
- func (ns *NetworkStorage) Delete() (err error)
- func (ns *NetworkStorage) EnsureDisk(size int) (err error)
- func (ns *NetworkStorage) Mount(path string) (err error)
- func (ns *NetworkStorage) Publish(nodeID string) error
- func (ns *NetworkStorage) Unmount(path string) (err error)
- func (ns *NetworkStorage) Unpublish(nodeID string) error
- func (ns *NetworkStorage) Wait() (err error)
- 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, in *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)
Constants ¶
const ( // DriverName defines the name that is used in Kubernetes and the CSI system for the canonical, official name of this plugin. DriverName = "csi.cloud.dk" // DriverVersion defines the driver's version number. DriverVersion = "0.1.0" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { ClientSettings *clouddk.ClientSettings Endpoint string NodeID string PrivateKey string PublicKey string ServerMemory int ServerProcessors int }
Configuration stores the driver configuration.
type ControllerServer ¶
type ControllerServer struct {
// contains filtered or unexported fields
}
ControllerServer implements the csi.ControllerServer interface.
func (*ControllerServer) ControllerExpandVolume ¶
func (cs *ControllerServer) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume expands the given volume.
func (*ControllerServer) ControllerGetCapabilities ¶
func (cs *ControllerServer) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the capabilities of the controller service.
func (*ControllerServer) ControllerPublishVolume ¶
func (cs *ControllerServer) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume attaches the given volume to the node.
func (*ControllerServer) ControllerUnpublishVolume ¶
func (cs *ControllerServer) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume deattaches the given volume from the node.
func (*ControllerServer) CreateSnapshot ¶
func (cs *ControllerServer) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
CreateSnapshot will be called by the CO to create a new snapshot from a source volume on behalf of a user.
func (*ControllerServer) CreateVolume ¶
func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume creates a new volume from the given request. The function is idempotent.
func (*ControllerServer) CreateVolumeBlockStorage ¶
func (cs *ControllerServer) CreateVolumeBlockStorage(ctx context.Context, req *csi.CreateVolumeRequest, size int) (*csi.CreateVolumeResponse, error)
CreateVolumeBlockStorage creates new block storage from the given request. The function is idempotent.
func (*ControllerServer) CreateVolumeNetworkStorage ¶
func (cs *ControllerServer) CreateVolumeNetworkStorage(ctx context.Context, req *csi.CreateVolumeRequest, size int) (*csi.CreateVolumeResponse, error)
CreateVolumeNetworkStorage creates new network storage from the given request. The function is idempotent.
func (*ControllerServer) DeleteSnapshot ¶
func (cs *ControllerServer) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot will be called by the CO to delete a snapshot.
func (*ControllerServer) DeleteVolume ¶
func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume deletes the given volume. The function is idempotent.
func (*ControllerServer) DeleteVolumeBlockStorage ¶
func (cs *ControllerServer) DeleteVolumeBlockStorage(ctx context.Context, req *csi.DeleteVolumeRequest, id string) (*csi.DeleteVolumeResponse, error)
DeleteVolumeBlockStorage deletes the given block storage. The function is idempotent.
func (*ControllerServer) DeleteVolumeNetworkStorage ¶
func (cs *ControllerServer) DeleteVolumeNetworkStorage(ctx context.Context, req *csi.DeleteVolumeRequest, id string) (*csi.DeleteVolumeResponse, error)
DeleteVolumeNetworkStorage deletes the given network storage. The function is idempotent.
func (*ControllerServer) GetCapacity ¶
func (cs *ControllerServer) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity returns the capacity of the storage pool.
func (*ControllerServer) ListSnapshots ¶
func (cs *ControllerServer) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots returns the information about all snapshots on the storage system within the given parameters regardless of how they were created. ListSnapshots shold not list a snapshot that is being created but has not been cut successfully yet.
func (*ControllerServer) ListVolumes ¶
func (cs *ControllerServer) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes returns a list of all requested volumes.
func (*ControllerServer) ValidateVolumeCapabilities ¶
func (cs *ControllerServer) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities checks whether the volume capabilities requested are supported.
type Driver ¶
type Driver struct { Configuration *Configuration Driver *csicommon.CSIDriver PackageID *string ControllerServer *ControllerServer IdentityServer *IdentityServer NodeServer *NodeServer ControllerCapabilities []*csi.ControllerServiceCapability NodeCapabilities []*csi.NodeServiceCapability PluginCapabilities []*csi.PluginCapability VolumeCapabilities []*csi.VolumeCapability }
Driver exposes the CSI driver for Cloud.dk.
func NewDriver ¶
func NewDriver(c *Configuration) (*Driver, error)
NewDriver returns a CSI plugin that manages Cloud.dk block storage
type IdentityServer ¶
type IdentityServer struct {
// contains filtered or unexported fields
}
IdentityServer implements the csi.IdentityServer interface.
func (*IdentityServer) GetPluginCapabilities ¶
func (is *IdentityServer) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns available capabilities of the plugin.
func (*IdentityServer) GetPluginInfo ¶
func (is *IdentityServer) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo returns metadata of the plugin.
func (*IdentityServer) Probe ¶
func (is *IdentityServer) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe returns the health and readiness of the plugin.
type NetworkStorage ¶
type NetworkStorage struct { ID string IP string Size int // contains filtered or unexported fields }
NetworkStorage implements the logic for creating ReadWriteMany volumes.
func (*NetworkStorage) CreateFile ¶
func (ns *NetworkStorage) CreateFile(sftpClient *sftp.Client, filePath string, fileContents *bytes.Buffer) error
CreateFile creates a file on the server.
func (*NetworkStorage) CreateSFTPClient ¶
CreateSFTPClient creates an SFTP client.
func (*NetworkStorage) CreateSSHClient ¶
func (ns *NetworkStorage) CreateSSHClient() (*ssh.Client, error)
CreateSSHClient establishes a new SSH connection to the server.
func (*NetworkStorage) CreateSSHSession ¶
CreateSSHSession creates an SSH session.
func (*NetworkStorage) Delete ¶
func (ns *NetworkStorage) Delete() (err error)
Delete deletes the network storage.
func (*NetworkStorage) EnsureDisk ¶
func (ns *NetworkStorage) EnsureDisk(size int) (err error)
EnsureDisk ensures that the server has a data disk of the specified size.
func (*NetworkStorage) Mount ¶
func (ns *NetworkStorage) Mount(path string) (err error)
Mount mounts the network storage at the specified path.
func (*NetworkStorage) Publish ¶
func (ns *NetworkStorage) Publish(nodeID string) error
Publish grants a node access to the network storage.
func (*NetworkStorage) Unmount ¶
func (ns *NetworkStorage) Unmount(path string) (err error)
Unmount unmounts the network storage from the specified path.
func (*NetworkStorage) Unpublish ¶
func (ns *NetworkStorage) Unpublish(nodeID string) error
Unpublish revokes a node's access to the network storage.
func (*NetworkStorage) Wait ¶
func (ns *NetworkStorage) Wait() (err error)
Wait waits for any pending and running transactions to end.
type NodeServer ¶
type NodeServer struct {
// contains filtered or unexported fields
}
NodeServer implements the csi.NodeServer interface.
func (*NodeServer) NodeExpandVolume ¶
func (ns *NodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume expands the given volume.
func (*NodeServer) NodeGetCapabilities ¶
func (ns *NodeServer) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities returns the supported capabilities of the node server.
func (*NodeServer) NodeGetInfo ¶
func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo returns the supported capabilities of the node server. This is used so the CO knows where to place the workload. The result of this function will be used by the CO in ControllerPublishVolume.
func (*NodeServer) NodeGetVolumeStats ¶
func (ns *NodeServer) NodeGetVolumeStats(ctx context.Context, in *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats returns the volume capacity statistics available for the the given volume.
func (*NodeServer) NodePublishVolume ¶
func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mounts the volume mounted to the staging path to the target path.
func (*NodeServer) NodeStageVolume ¶
func (ns *NodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume mounts the volume to a staging path on the node. This is called by the CO before NodePublishVolume and is used to temporary mount the volume to a staging path. Once mounted, NodePublishVolume will make sure to mount it to the appropriate path.
func (*NodeServer) NodeUnpublishVolume ¶
func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmounts the volume from the target path.
func (*NodeServer) NodeUnstageVolume ¶
func (ns *NodeServer) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unstages the volume from the staging path.