Documentation ¶
Index ¶
- Constants
- func GetUserAgent(driverName, customUserAgent, userAgentSuffix string) string
- func GetVersionYAML(driverName string) (string, error)
- func IsCorruptedDir(dir string) bool
- type Driver
- func (d *Driver) ControllerGetCapabilities(_ context.Context, _ *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (d *Driver) CreateVolume(_ context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (d *Driver) DeleteVolume(_ context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (f *Driver) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (f *Driver) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (d *Driver) NodeGetCapabilities(_ context.Context, _ *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (d *Driver) NodeGetInfo(_ context.Context, _ *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (d *Driver) NodeGetVolumeStats(_ context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (d *Driver) NodePublishVolume(_ context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (d *Driver) NodeStageVolume(_ context.Context, _ *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (d *Driver) NodeUnpublishVolume(_ context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (d *Driver) NodeUnstageVolume(_ context.Context, _ *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (f *Driver) Probe(_ context.Context, _ *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) Run(endpoint string, testBool bool)
- func (d *Driver) ValidateVolumeCapabilities(_ context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type DriverOptions
- type VersionInfo
Constants ¶
const ( VolumeContextMGSIPAddress = "mgs-ip-address" VolumeContextFSName = "fs-name" VolumeContextSubDir = "sub-dir" )
const (
// DefaultDriverName holds the name of the csi-driver
DefaultDriverName = "azurelustre.csi.azure.com"
)
Variables ¶
This section is empty.
Functions ¶
func GetUserAgent ¶
GetUserAgent returns user agent of the driver
func GetVersionYAML ¶
GetVersionYAML returns the version information of the driver in YAML format
func IsCorruptedDir ¶
Types ¶
type Driver ¶
type Driver struct { csicommon.CSIDriver csicommon.DefaultIdentityServer csicommon.DefaultControllerServer csicommon.DefaultNodeServer // contains filtered or unexported fields }
Driver implements all interfaces of CSI drivers
func NewDriver ¶
func NewDriver(options *DriverOptions) *Driver
NewDriver Creates a NewCSIDriver object. Assumes vendor version is equal to driver version & does not support optional driver plugin info manifest field. Refer to CSI spec for more details.
func (*Driver) ControllerGetCapabilities ¶
func (d *Driver) ControllerGetCapabilities( _ context.Context, _ *csi.ControllerGetCapabilitiesRequest, ) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the capabilities of the Controller plugin
func (*Driver) CreateVolume ¶
func (d *Driver) CreateVolume( _ context.Context, req *csi.CreateVolumeRequest, ) (*csi.CreateVolumeResponse, error)
CreateVolume provisions a volume
func (*Driver) DeleteVolume ¶
func (d *Driver) DeleteVolume( _ context.Context, req *csi.DeleteVolumeRequest, ) (*csi.DeleteVolumeResponse, error)
DeleteVolume delete a volume
func (*Driver) GetPluginCapabilities ¶
func (f *Driver) GetPluginCapabilities(_ context.Context, _ *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns the capabilities of the plugin
func (*Driver) GetPluginInfo ¶
func (f *Driver) GetPluginInfo(_ context.Context, _ *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo return the version and name of the plugin
func (*Driver) NodeGetCapabilities ¶
func (d *Driver) NodeGetCapabilities( _ context.Context, _ *csi.NodeGetCapabilitiesRequest, ) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities return the capabilities of the Node plugin
func (*Driver) NodeGetInfo ¶
func (d *Driver) NodeGetInfo( _ context.Context, _ *csi.NodeGetInfoRequest, ) (*csi.NodeGetInfoResponse, error)
NodeGetInfo return info of the node on which this plugin is running
func (*Driver) NodeGetVolumeStats ¶
func (d *Driver) NodeGetVolumeStats( _ context.Context, req *csi.NodeGetVolumeStatsRequest, ) (*csi.NodeGetVolumeStatsResponse, error)
NodeGetVolumeStats get volume stats
func (*Driver) NodePublishVolume ¶
func (d *Driver) NodePublishVolume( _ context.Context, req *csi.NodePublishVolumeRequest, ) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mount the volume from staging to target path
func (*Driver) NodeStageVolume ¶ added in v0.1.13
func (d *Driver) NodeStageVolume(_ context.Context, _ *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
Staging and Unstaging is not able to be supported with how Lustre is mounted
This was discovered during a proof of concept implementation and the issue is as follows:
When the kubelet process attempts to unstage / unmount a Lustre mount that has been staged to a global mount point, it performs extra checks to ensure that the same device is not mounted anywhere else in the filesystem. For usual configurations, this would be a reasonable check to ensure that we aren't trying to remove something that is still in use elsewhere in the system. However, the way Lustre mounts are configured is not compatible with the check it performs.
The kubelet process does this by checking all of the mount points on the node to see if any have the following: 1) The same 'root' value of the mount that is being cleaned 2) The same device number of the mount that is being cleaned And that those mounts are in a different path tree. If so, it returns this error: "the device mount path %q is still mounted by other references %v", deviceMountPath, refs) and fails the unmount. See pkg/volume/util/operationexecutor/operation_generator.go calling GetDeviceMountRefs(deviceMountPath) around line 947.
All Lustre mounts on a system, no matter where in the lustrefs they are mounted to, all have '/' as the root and they all have the same major and minor device numbers, so as far as this check is concerned, every lustre mount is the same device, even though individual Lustre mount points can be unmounted without affecting others and should not be a concern.
With a single Lustre volume mount, this works fine. It stages to a globalpath dir, pods can bind mount into that, and when the last pod is done, unstage is called and the global mount point can be cleaned up, because that is the only lustre mount so kubelet has no issue with 'other mounts' on the same node.
The problem occurs when two different volumes are trying to mount a Lustre cluster. In that case, pods for the first volume can come up as expected with their global mount path, then pods for the second volume with their global mount path. The error occurs when the pods for one of these volumes are deleted and an unstage action should occur, because the other volume has its own Lustre mount, so it fails this check. For example, it's trying to unmount /var/...<firstvolume>.../globalpath, but there's another volume at /var/...<secondvolume>.../globalpath with the same root '/' and major and minor device numbers.
It errors out, fails the unmount, and never calls unstage, even though all of the pods using that volume have already been deleted. This leaves the box with as many global mount directories still mounted to the Lustre cluster as you've ever staged, but without any way to see this other than looking at the mounts on the node or in the kubelet logs.
func (*Driver) NodeUnpublishVolume ¶
func (d *Driver) NodeUnpublishVolume( _ context.Context, req *csi.NodeUnpublishVolumeRequest, ) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmount the volume from the target path
func (*Driver) NodeUnstageVolume ¶ added in v0.1.13
func (d *Driver) NodeUnstageVolume(_ context.Context, _ *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
Staging and Unstaging is not able to be supported with how Lustre is mounted
See NodeStageVolume for more details
func (*Driver) Probe ¶
func (f *Driver) Probe(_ context.Context, _ *csi.ProbeRequest) (*csi.ProbeResponse, error)
Probe check whether the plugin is running or not. This method does not need to return anything. Currently the spec does not dictate what you should return either. Hence, return an empty response
func (*Driver) ValidateVolumeCapabilities ¶
func (d *Driver) ValidateVolumeCapabilities( _ context.Context, req *csi.ValidateVolumeCapabilitiesRequest, ) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities return the capabilities of the volume
type DriverOptions ¶
type DriverOptions struct { NodeID string DriverName string EnableAzureLustreMockMount bool WorkingMountDir string }
DriverOptions defines driver parameters specified in driver deployment
type VersionInfo ¶
type VersionInfo struct { DriverName string `json:"Driver Name"` DriverVersion string `json:"Driver Version"` GitCommit string `json:"Git Commit"` BuildDate string `json:"Build Date"` GoVersion string `json:"Go Version"` Compiler string `json:"Compiler"` Platform string `json:"Platform"` }
VersionInfo holds the version information of the driver
func GetVersion ¶
func GetVersion(driverName string) VersionInfo
GetVersion returns the version information of the driver