driver

package
v0.0.0-...-0bc053b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2019 License: MPL-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
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

ControllerExpandVolume expands the given volume.

func (*ControllerServer) ControllerGetCapabilities

ControllerGetCapabilities returns the capabilities of the controller service.

func (*ControllerServer) ControllerPublishVolume

ControllerPublishVolume attaches the given volume to the node.

func (*ControllerServer) ControllerUnpublishVolume

ControllerUnpublishVolume deattaches the given volume from the node.

func (*ControllerServer) CreateSnapshot

CreateSnapshot will be called by the CO to create a new snapshot from a source volume on behalf of a user.

func (*ControllerServer) CreateVolume

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

DeleteSnapshot will be called by the CO to delete a snapshot.

func (*ControllerServer) DeleteVolume

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

GetCapacity returns the capacity of the storage pool.

func (*ControllerServer) ListSnapshots

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

ListVolumes returns a list of all requested volumes.

func (*ControllerServer) ValidateVolumeCapabilities

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

func (*Driver) Run

func (d *Driver) Run()

Run starts the CSI driver.

type IdentityServer

type IdentityServer struct {
	// contains filtered or unexported fields
}

IdentityServer implements the csi.IdentityServer interface.

func (*IdentityServer) GetPluginCapabilities

GetPluginCapabilities returns available capabilities of the plugin.

func (*IdentityServer) GetPluginInfo

GetPluginInfo returns metadata of the plugin.

func (*IdentityServer) Probe

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

func (ns *NetworkStorage) CreateSFTPClient(sshClient *ssh.Client) (*sftp.Client, error)

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

func (ns *NetworkStorage) CreateSSHSession(sshClient *ssh.Client) (*ssh.Session, error)

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

NodeExpandVolume expands the given volume.

func (*NodeServer) NodeGetCapabilities

NodeGetCapabilities returns the supported capabilities of the node server.

func (*NodeServer) NodeGetInfo

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

NodeGetVolumeStats returns the volume capacity statistics available for the the given volume.

func (*NodeServer) NodePublishVolume

NodePublishVolume mounts the volume mounted to the staging path to the target path.

func (*NodeServer) NodeStageVolume

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

NodeUnpublishVolume unmounts the volume from the target path.

func (*NodeServer) NodeUnstageVolume

NodeUnstageVolume unstages the volume from the staging path.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL