Documentation ¶
Index ¶
- Constants
- type ControllerInfo
- type DeviceList
- type Driver
- func (drv *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (drv *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (drv *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (drv *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (drv *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (drv *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (drv *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (drv *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (drv *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (drv *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (drv *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (drv *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (drv *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (drv *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (drv *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (drv *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (drv *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (drv *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (drv *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (drv *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (drv *Driver) Run() error
- func (drv *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type Mounter
- type NVMe
- type Volume
Constants ¶
const ( KB = 1 << (10 * iota) MB GB TB )
Size constants (Kilobytes, Megabytes, etc)
const ( // DriverName defines the name that is used in Kubernetes and the CSI // system for the canonical, official name of this plugin DriverName = "csi.rsd.intel.com" // DriverVersion defines current CSI Driver version DriverVersion = "0.0.1" // PublishInfoVolumeName is used to pass the volume name from // `ControllerPublishVolume` to `NodeStageVolume or `NodePublishVolume` PublishInfoVolumeName = DriverName + "/volume-name" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControllerInfo ¶
type ControllerInfo struct {
Subnqn string `json:"subnqn"`
}
ControllerInfo declares only SubNQN as it's the only attribute we use
type DeviceList ¶
type DeviceList struct { Devices []struct { DevicePath string `json:"DevicePath"` } `json:"Devices"` }
DeviceList declares list of NVME device paths
type Driver ¶
Driver implements the following CSI interfaces:
csi.IdentityServer csi.ControllerServer csi.NodeServer
func NewDriver ¶
NewDriver returns a CSI plugin that contains the necessary gRPC interfaces to interact with Kubernetes over unix domain socket
func (*Driver) ControllerGetCapabilities ¶
func (drv *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the capabilities of the controller service.
func (*Driver) ControllerPublishVolume ¶
func (drv *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume attaches the given volume to the node
func (*Driver) ControllerUnpublishVolume ¶
func (drv *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume deattaches the given volume from the node
func (*Driver) CreateSnapshot ¶
func (drv *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
CreateSnapshot creates new volume snapshot
func (*Driver) CreateVolume ¶
func (drv *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume creates new RSD Volume
func (*Driver) DeleteSnapshot ¶
func (drv *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot deletes volume snapshot
func (*Driver) DeleteVolume ¶
func (drv *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume deletes existing RSD Volume
func (*Driver) GetCapacity ¶
func (drv *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity returns the capacity of the storage
func (*Driver) GetPluginCapabilities ¶
func (drv *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns available capabilities of the plugin
func (*Driver) GetPluginInfo ¶
func (drv *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo returns metadata of the plugin
func (*Driver) ListSnapshots ¶
func (drv *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots returns a list of requested volume snapshots
func (*Driver) ListVolumes ¶
func (drv *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes returns a list of available volumes created by the driver
func (*Driver) NodeGetCapabilities ¶
func (drv *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities returns the supported capabilities of the node server
func (*Driver) NodeGetInfo ¶
func (drv *Driver) 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 (*Driver) NodeGetVolumeStats ¶
func (drv *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats returns the volume capacity statistics available for the given volume.
func (*Driver) NodePublishVolume ¶
func (drv *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mounts the volume mounted to the staging path to the target path
func (*Driver) NodeStageVolume ¶
func (drv *Driver) 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 bindmount it to the appropriate path
func (*Driver) NodeUnpublishVolume ¶
func (drv *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmounts the volume from the target path
func (*Driver) NodeUnstageVolume ¶
func (drv *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unstages the volume from the staging path
func (*Driver) Probe ¶
func (drv *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe returns the health and readiness of the plugin
func (*Driver) ValidateVolumeCapabilities ¶
func (drv *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities checks if requested volume capabilities are supported
type Mounter ¶
type Mounter interface { // Mount mounts source to target as fstype with given options. Mount(source string, target string, fstype string, opts ...string) error // Unmount unmounts given target. Unmount(target string) error /// IsMounted checks whether the source device is mounted to the target // path. Source can be empty. In that case it only checks whether the // device is mounted or not. // It returns true if it's mounted. IsMounted(source, target string) (bool, error) // IsFormatted checks whether the source device is formatted or not. It // returns true if the source device is already formatted. IsFormatted(source string) (bool, error) // Format formats the source with the given filesystem type Format(source, fsType string) error }
Mounter interface declares volume mounting and formatting operations
type NVMe ¶
type NVMe interface { // Connect to NVMe subsystem Connect(transport, traddr, traddrfamily, trsvcid, nqn, hostnqn string) (string, error) // Disconnect from NVMe subystem Disconnect(device string) error }
NVMe interface declares NVMe operations required by the RSD CSI driver
type Volume ¶
type Volume struct { Name string CSIVolume *csi.Volume RSDVolume *rsd.Volume EndPoint *endPointInfo RSDNodeID string RSDNodeNQN string Device string IsPublished bool IsStaged bool StagingTargetPath string TargetPaths map[string]bool }
Volume contains mapping between CSI and RSD volumes and internal driver information about a volume status