Documentation ¶
Index ¶
- Constants
- Variables
- func CleanupMountPoint(path string, m *mount.SafeFormatAndMount, extensiveCheck bool) error
- func GetCloudProvider(kubeconfig string) (*azure.Cloud, error)
- func GetDiskName(diskURI string) (string, error)
- func GetResourceGroupFromURI(diskURI string) (string, error)
- func GetVersionYAML() (string, error)
- func IsAzureStackCloud(cloud string, disableAzureStackCloud bool) bool
- func IsCorruptedDir(dir string) bool
- func IsLinuxOS() bool
- func IsWindowsOS() bool
- func NewFakeMounter() (*mount.SafeFormatAndMount, error)
- func PopulateNodeAndSkuInfo(d *DriverCore) error
- type CSIDriver
- type DeviceHelper
- type DiskSkuInfo
- type Driver
- func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (d *Driver) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (f *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (d *Driver) GetSourceDiskSize(ctx context.Context, resourceGroup, diskName string, curDepth, maxDepth int) (*int32, error)
- func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (f *Driver) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (d *Driver) Run(endpoint, kubeconfig string, disableAVSetNodes, testingMock bool)
- func (d *Driver) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type DriverCore
- type FakeDriver
- type Interface
- type NodeInfo
- type SafeDeviceHelper
- type VersionInfo
Constants ¶
const ( // DriverName driver name DriverName = "disk.csi.azure.com" // LUN lun number LUN = "LUN" WellKnownTopologyKey = "topology.kubernetes.io/zone" )
const ( PerfProfileNone = "none" PerfProfileBasic = "basic" PremiumAccountPrefix = "premium" StandardSsdAccountPrefix = "standardssd" )
const (
NotFound = "NotFound"
)
Variables ¶
var ( DefaultAzureCredentialFileEnv = "AZURE_CREDENTIAL_FILE" DefaultCredFilePathLinux = "/etc/kubernetes/azure.json" DefaultCredFilePathWindows = "C:\\k\\azure.json" )
var ( DiskSkuMap = map[string]map[string]DiskSkuInfo{ "premium_lrs": { "p40": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P40", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 2048}, "p2": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P2", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 8}, "p3": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P3", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 16}, "p4": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P4", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 32}, "p10": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P10", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 500, MaxBwMbps: 100, MaxBurstBwMbps: 170, MaxSizeGiB: 128}, "p20": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P20", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 2300, MaxBwMbps: 150, MaxBurstBwMbps: 170, MaxSizeGiB: 512}, "p80": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P80", MaxAllowedShares: 10, MaxBurstIops: 20000, MaxIops: 20000, MaxBwMbps: 900, MaxBurstBwMbps: 900, MaxSizeGiB: 32767}, "p6": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P6", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 240, MaxBwMbps: 50, MaxBurstBwMbps: 170, MaxSizeGiB: 64}, "p15": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P15", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 1100, MaxBwMbps: 125, MaxBurstBwMbps: 170, MaxSizeGiB: 256}, "p30": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P30", MaxAllowedShares: 5, MaxBurstIops: 5000, MaxIops: 5000, MaxBwMbps: 200, MaxBurstBwMbps: 200, MaxSizeGiB: 1024}, "p50": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P50", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 4096}, "p70": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P70", MaxAllowedShares: 10, MaxBurstIops: 18000, MaxIops: 18000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 16384}, "p1": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P1", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 4}, "p60": {StorageAccountType: "Premium_LRS", StorageTier: "Premium", DiskSize: "P60", MaxAllowedShares: 10, MaxBurstIops: 16000, MaxIops: 16000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 8192}, }, "standardssd_lrs": { "e70": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E70", MaxAllowedShares: 5, MaxBurstIops: 4000, MaxIops: 4000, MaxBwMbps: 600, MaxBurstBwMbps: 600, MaxSizeGiB: 16384}, "e2": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E2", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 8}, "e10": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E10", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 128}, "e80": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E80", MaxAllowedShares: 5, MaxBurstIops: 6000, MaxIops: 6000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 32767}, "e15": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E15", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 256}, "e20": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E20", MaxAllowedShares: 2, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 512}, "e4": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E4", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 32}, "e30": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E30", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 1024}, "e40": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E40", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 2048}, "e60": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E60", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 400, MaxBurstBwMbps: 400, MaxSizeGiB: 8192}, "e1": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E1", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4}, "e3": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E3", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 16}, "e6": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E6", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 64}, "e50": {StorageAccountType: "StandardSSD_LRS", StorageTier: "Standard", DiskSize: "E50", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4096}, }, "ultrassd_lrs": { "u": {StorageAccountType: "UltraSSD_LRS", StorageTier: "Ultra", DiskSize: "U", MaxAllowedShares: 5, MaxBurstIops: 0, MaxIops: 0, MaxBwMbps: 0, MaxBurstBwMbps: 0, MaxSizeGiB: 65536}, }, "standardssd_zrs": { "e1": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E1", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4}, "e10": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E10", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 128}, "e30": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E30", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 1024}, "e40": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E40", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 2048}, "e50": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E50", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4096}, "e2": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E2", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 8}, "e3": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E3", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 16}, "e4": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E4", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 32}, "e6": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E6", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 64}, "e20": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E20", MaxAllowedShares: 2, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 512}, "e80": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E80", MaxAllowedShares: 5, MaxBurstIops: 6000, MaxIops: 6000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 32767}, "e15": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E15", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 256}, "e60": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E60", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 400, MaxBurstBwMbps: 400, MaxSizeGiB: 8192}, "e70": {StorageAccountType: "StandardSSD_ZRS", StorageTier: "Standard", DiskSize: "E70", MaxAllowedShares: 5, MaxBurstIops: 4000, MaxIops: 4000, MaxBwMbps: 600, MaxBurstBwMbps: 600, MaxSizeGiB: 16384}, }, "premium_zrs": { "p2": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P2", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 8}, "p40": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P40", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 2048}, "p80": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P80", MaxAllowedShares: 10, MaxBurstIops: 20000, MaxIops: 20000, MaxBwMbps: 900, MaxBurstBwMbps: 900, MaxSizeGiB: 32767}, "p70": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P70", MaxAllowedShares: 10, MaxBurstIops: 18000, MaxIops: 18000, MaxBwMbps: 750, MaxBurstBwMbps: 750, MaxSizeGiB: 16384}, "p3": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P3", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 16}, "p15": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P15", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 1100, MaxBwMbps: 125, MaxBurstBwMbps: 170, MaxSizeGiB: 256}, "p50": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P50", MaxAllowedShares: 5, MaxBurstIops: 7500, MaxIops: 7500, MaxBwMbps: 250, MaxBurstBwMbps: 250, MaxSizeGiB: 4096}, "p60": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P60", MaxAllowedShares: 10, MaxBurstIops: 16000, MaxIops: 16000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 8192}, "p20": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P20", MaxAllowedShares: 2, MaxBurstIops: 3500, MaxIops: 2300, MaxBwMbps: 150, MaxBurstBwMbps: 170, MaxSizeGiB: 512}, "p1": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P1", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 4}, "p4": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P4", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 120, MaxBwMbps: 25, MaxBurstBwMbps: 170, MaxSizeGiB: 32}, "p6": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P6", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 240, MaxBwMbps: 50, MaxBurstBwMbps: 170, MaxSizeGiB: 64}, "p10": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P10", MaxAllowedShares: 1, MaxBurstIops: 3500, MaxIops: 500, MaxBwMbps: 100, MaxBurstBwMbps: 170, MaxSizeGiB: 128}, "p30": {StorageAccountType: "Premium_ZRS", StorageTier: "Premium", DiskSize: "P30", MaxAllowedShares: 5, MaxBurstIops: 5000, MaxIops: 5000, MaxBwMbps: 200, MaxBurstBwMbps: 200, MaxSizeGiB: 1024}, }, "standard_lrs": { "s30": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S30", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 1024}, "s60": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S60", MaxAllowedShares: 5, MaxBurstIops: 1300, MaxIops: 1300, MaxBwMbps: 300, MaxBurstBwMbps: 300, MaxSizeGiB: 8192}, "s40": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S40", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 2048}, "s50": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S50", MaxAllowedShares: 5, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 4096}, "s70": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S70", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 16384}, "s4": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S4", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 32}, "s6": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S6", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 64}, "s10": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S10", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 128}, "s15": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S15", MaxAllowedShares: 1, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 256}, "s20": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S20", MaxAllowedShares: 2, MaxBurstIops: 500, MaxIops: 500, MaxBwMbps: 60, MaxBurstBwMbps: 60, MaxSizeGiB: 512}, "s80": {StorageAccountType: "Standard_LRS", StorageTier: "Standard", DiskSize: "S80", MaxAllowedShares: 5, MaxBurstIops: 2000, MaxIops: 2000, MaxBwMbps: 500, MaxBurstBwMbps: 500, MaxSizeGiB: 32767}, }, } NodeInfoMap = map[string]NodeInfo{}/* 399 elements not displayed */ )
Functions ¶
func CleanupMountPoint ¶ added in v0.7.0
func GetCloudProvider ¶
GetCloudProvider get Azure Cloud Provider
func GetDiskName ¶ added in v0.8.0
func GetResourceGroupFromURI ¶ added in v0.8.0
func GetVersionYAML ¶
GetVersionYAML returns the version information of the driver in YAML format
func IsAzureStackCloud ¶ added in v0.10.0
IsAzureStackCloud decides whether the driver is running on Azure Stack Cloud.
func IsCorruptedDir ¶ added in v0.7.0
func IsLinuxOS ¶ added in v1.4.0
func IsLinuxOS() bool
IsLinuxOS decides whether the driver is running on linux OS.
func IsWindowsOS ¶ added in v1.4.0
func IsWindowsOS() bool
IsWindowsOS decides whether the driver is running on windows OS.
func NewFakeMounter ¶ added in v0.10.0
func NewFakeMounter() (*mount.SafeFormatAndMount, error)
func PopulateNodeAndSkuInfo ¶ added in v1.4.0
func PopulateNodeAndSkuInfo(d *DriverCore) error
PopulateNodeAndSkuInfo populates Node and Sku related information in memory
Types ¶
type CSIDriver ¶ added in v1.1.1
type CSIDriver interface { csi.ControllerServer csi.NodeServer csi.IdentityServer Run(endpoint, kubeconfig string, disableAVSetNodes, testMode bool) }
CSIDriver defines the interface for a CSI driver.
type DeviceHelper ¶ added in v1.4.0
type DeviceHelper struct{}
func (*DeviceHelper) DiskSupportsPerfOptimization ¶ added in v1.4.0
func (deviceHelper *DeviceHelper) DiskSupportsPerfOptimization(diskPerfProfile, diskAccountType string) bool
func (*DeviceHelper) OptimizeDiskPerformance ¶ added in v1.4.0
func (deviceHelper *DeviceHelper) OptimizeDiskPerformance(nodeInfo *NodeInfo, diskSkus map[string]map[string]DiskSkuInfo, devicePath, perfProfile, accountType, diskSizeGibStr, diskIopsStr, diskBwMbpsStr string) (err error)
OptimizeDiskPerformance optimizes device performance by setting tuning block device settings
type DiskSkuInfo ¶ added in v1.4.0
type DiskSkuInfo struct { StorageAccountType string StorageTier string DiskSize string MaxBurstIops int MaxIops int MaxBwMbps int MaxBurstBwMbps int MaxSizeGiB int }
DiskSkuInfo stores disk sku information disk sku information is present in sku.json in below format
{ "resourceType": "disks", "name": "Premium_LRS", "tier": "Premium", "size": "P4", "capabilities": [ { "name": "MaxSizeGiB", "value": "32" { "name": "MaxIOps", "value": "120" }, { "name": "MaxBandwidthMBps", "value": "25" }, { "name": "MaxValueOfMaxShares", "value": "1" }, { "name": "MaxBurstIops", "value": "3500" }, { "name": "MaxBurstBandwidthMBps", "value": "170" } ] }
func (*DiskSkuInfo) GetRandomIOLatencyInSec ¶ added in v1.4.0
func (sku *DiskSkuInfo) GetRandomIOLatencyInSec() float64
GetRandomIOLatencyInSec gets the estimated random IP latency for a small write for a disk size These latencies are manually calculated and stored ToDo: Make this estimation dynamic
func (*DiskSkuInfo) GetSequentialOLatencyInSec ¶ added in v1.4.0
func (sku *DiskSkuInfo) GetSequentialOLatencyInSec() float64
GetSequentialOLatencyInSec gets the estimated sequential IO latency for a disk size These latencies are manually calculated and stored ToDo: Make this estimation dynamic
type Driver ¶
type Driver struct { DriverCore // contains filtered or unexported fields }
Driver is the v1 implementation of the Azure Disk CSI Driver.
func (*Driver) ControllerExpandVolume ¶
func (d *Driver) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
ControllerExpandVolume controller expand volume
func (*Driver) ControllerGetCapabilities ¶
func (d *Driver) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
ControllerGetCapabilities returns the capabilities of the Controller plugin
func (*Driver) ControllerGetVolume ¶ added in v0.8.0
func (d *Driver) ControllerGetVolume(context.Context, *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
ControllerGetVolume get volume
func (*Driver) ControllerPublishVolume ¶
func (d *Driver) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume attach an azure disk to a required node
func (*Driver) ControllerUnpublishVolume ¶
func (d *Driver) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume detach an azure disk from a required node
func (*Driver) CreateSnapshot ¶
func (d *Driver) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
CreateSnapshot create a snapshot
func (*Driver) CreateVolume ¶
func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
CreateVolume provisions an azure disk
func (*Driver) DeleteSnapshot ¶
func (d *Driver) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot delete a snapshot
func (*Driver) DeleteVolume ¶
func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
DeleteVolume delete an azure disk
func (*Driver) GetCapacity ¶
func (d *Driver) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity returns the capacity of the total available storage pool
func (*Driver) GetPluginCapabilities ¶
func (f *Driver) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
GetPluginCapabilities returns the capabilities of the plugin
func (*Driver) GetPluginInfo ¶
func (f *Driver) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
GetPluginInfo return the version and name of the plugin
func (*Driver) GetSourceDiskSize ¶ added in v1.0.0
func (d *Driver) GetSourceDiskSize(ctx context.Context, resourceGroup, diskName string, curDepth, maxDepth int) (*int32, error)
GetSourceDiskSize recursively searches for the sourceDisk and returns: sourceDisk disk size, error
func (*Driver) ListSnapshots ¶
func (d *Driver) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots list all snapshots
func (*Driver) ListVolumes ¶
func (d *Driver) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes return all available volumes
func (*Driver) NodeExpandVolume ¶
func (d *Driver) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
NodeExpandVolume node expand volume
func (*Driver) NodeGetCapabilities ¶
func (d *Driver) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
NodeGetCapabilities return the capabilities of the Node plugin
func (*Driver) NodeGetInfo ¶
func (d *Driver) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
NodeGetInfo return info of the node on which this plugin is running
func (*Driver) NodeGetVolumeStats ¶
func (d *Driver) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
func (*Driver) NodePublishVolume ¶
func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
NodePublishVolume mount the volume from staging to target path
func (*Driver) NodeStageVolume ¶
func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
NodeStageVolume mount disk device to a staging path
func (*Driver) NodeUnpublishVolume ¶
func (d *Driver) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
NodeUnpublishVolume unmount the volume from the target path
func (*Driver) NodeUnstageVolume ¶
func (d *Driver) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
NodeUnstageVolume unmount disk device from a staging path
func (*Driver) Probe ¶
func (f *Driver) Probe(ctx context.Context, req *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(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
ValidateVolumeCapabilities return the capabilities of the volume
type DriverCore ¶ added in v1.1.1
DriverCore contains fields common to both the V1 and V2 driver, and implements all interfaces of CSI drivers
type FakeDriver ¶ added in v1.1.1
type FakeDriver interface { CSIDriver GetSourceDiskSize(ctx context.Context, resourceGroup, diskName string, curDepth, maxDepth int) (*int32, error) // contains filtered or unexported methods }
FakeDriver defines an interface unit tests use to test either the v1 or v2 implementation of the Azure Disk CSI Driver.
func NewFakeDriver ¶ added in v0.7.0
func NewFakeDriver(t *testing.T) (FakeDriver, error)
NewFakeDriver returns a driver implementation suitable for use in unit tests.
type Interface ¶ added in v1.4.0
type Interface interface { DiskSupportsPerfOptimization(diskPerfProfile, diskAccountType string) bool OptimizeDiskPerformance(nodeInfo *NodeInfo, diskSkus map[string]map[string]DiskSkuInfo, devicePath, perfProfile, accountType, diskSizeGibStr, diskIopsStr, diskBwMbpsStr string) error }
This is the interface for DeviceHelper
type NodeInfo ¶ added in v1.4.0
type NodeInfo struct { SkuName string Zone string Region string MaxDataDiskCount int VCpus int MaxBurstIops int MaxIops int MaxBwMbps int MaxBurstBwMbps int }
NodeInfo stores VM/Node specific static information VM information is present in sku.json in below format
{ "resourceType": "virtualmachines", "name": "Standard_E16-4ds_v4", "tier": "Standard", "size": "E16-4ds_v4", "capabilities": [ { "name": "vCPUs", "value": "16" }, { "name": "MemoryGB", "value": "128" }, { "name": "MaxDataDiskCount", "value": "32" }, { "name": "UncachedDiskIOPS", "value": "25600" }, { "name": "UncachedDiskBytesPerSecond", "value": "402653184" } ] }
type SafeDeviceHelper ¶ added in v1.4.0
type SafeDeviceHelper struct {
Interface
}
IdentityServer is the server API for Identity service.
func NewSafeDeviceHelper ¶ added in v1.4.0
func NewSafeDeviceHelper() *SafeDeviceHelper
func (*SafeDeviceHelper) DeviceSupportsPerfOptimization ¶ added in v1.4.0
func (dh *SafeDeviceHelper) DeviceSupportsPerfOptimization(diskPerfProfile, diskAccountType string) bool
func (*SafeDeviceHelper) OptimizeDiskPerformance ¶ added in v1.4.0
func (dh *SafeDeviceHelper) OptimizeDiskPerformance(nodeInfo *NodeInfo, diskSkus map[string]map[string]DiskSkuInfo, devicePath, perfProfile, accountType, diskSizeGibStr, diskIopsStr, diskBwMbpsStr string) error
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"` TopologyKey string `json:"Topology Key"` }
VersionInfo holds the version information of the driver
func GetVersion ¶
func GetVersion() VersionInfo
GetVersion returns the version information of the driver
Source Files ¶
- azure.go
- azure_common.go
- azure_common_linux.go
- azure_common_unix.go
- azure_dd_max_disk_count.go
- azure_skus_map.go
- azuredisk.go
- azuredisk_v1.go
- controllerserver.go
- device_perf_optimization.go
- device_perf_optimization_helper.go
- device_perf_optimization_linux.go
- fake_azuredisk.go
- fake_azuredisk_v1.go
- fake_mounter.go
- identityserver.go
- nodeserver.go
- skus.go
- version.go
Directories ¶
Path | Synopsis |
---|---|
Package mockcorev1 implements the mock client for corev1.
|
Package mockcorev1 implements the mock client for corev1. |
Package mockkubeclient implements the mock client for kubeclient.
|
Package mockkubeclient implements the mock client for kubeclient. |
Package mockpersistentvolume implements the mock client for persistentvolumegetter.
|
Package mockpersistentvolume implements the mock client for persistentvolumegetter. |