Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertIscsiIpFromIpv4ToIpv6(ipv4IscsiIp string) (string, error)
- func CreateFilePath(logger *zap.SugaredLogger, path string) error
- func ExtractBlockVolumePerformanceLevel(attribute string) (int64, error)
- func ExtractISCSIInformation(attributes map[string]string) (*disk.Disk, error)
- func ExtractISCSIInformationFromMountPath(logger *zap.SugaredLogger, diskPath []string) (*disk.Disk, error)
- func ExtractStorage(capRange *csi.CapacityRange) (int64, error)
- func FormatBytes(inputBytes int64) string
- func FormatValidIp(ipAddress string) string
- func FormatValidIpStackInK8SConvention(ipStack string) string
- func GetBlockSizeBytes(logger *zap.SugaredLogger, devicePath string) (int64, error)
- func GetIsFeatureEnabledFromEnv(logger *zap.SugaredLogger, featureName string, defaultValue bool) bool
- func GetKubeClient(logger *zap.SugaredLogger, master, kubeconfig string) *kubernetes.Clientset
- func GetPathForBlock(volumePath string) string
- func IsDualStackSubnet(subnet *core.Subnet) bool
- func IsFipsEnabled() (string, error)
- func IsInTransitEncryptionPackageInstalled() (bool, error)
- func IsIpv4(ipAddress string) bool
- func IsIpv4SingleStackSubnet(subnet *core.Subnet) bool
- func IsIpv6(ipAddress string) bool
- func IsIpv6SingleStackNode(nodeMetadata *NodeMetadata) bool
- func IsIpv6SingleStackSubnet(subnet *core.Subnet) bool
- func IsValidIpFamilyPresentInClusterIpFamily(clusterIpFamily string) bool
- func LoadCSIConfigFromConfigMap(csiConfig *CSIConfig, k kubernetes.Interface, configMapName string, ...)
- func MaxOfInt(a, b int64) int64
- func RoundUpMinSize() int64
- func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64
- func ValidateDNSName(name string) bool
- func ValidateFsType(logger *zap.SugaredLogger, fsType string) string
- func ValidateLustreParameters(logger *zap.SugaredLogger, lustreParamsJson string) error
- func ValidateLustreVolumeId(lusterVolumeId string) (bool, string)
- type CSIConfig
- type DriverConfig
- type FSSVolumeHandler
- type LnetConfigurator
- type LnetService
- type NetInfo
- type NetInterface
- type NodeMetadata
- type OCILnetConfigurator
- func (olc *OCILnetConfigurator) ConfigureLnet(logger *zap.SugaredLogger, interfacesInLustreSubnet []NetInterface, ...) error
- func (olc *OCILnetConfigurator) ExecuteCommandOnWorkerNode(args ...string) (string, error)
- func (olc *OCILnetConfigurator) GetLnetInfoByLnetLabel(lnetLabel string) (NetInfo, error)
- func (olc *OCILnetConfigurator) GetNetInterfacesInSubnet(subnetCIDR string) ([]NetInterface, error)
- func (olc *OCILnetConfigurator) IsLustreClientPackagesInstalled(logger *zap.SugaredLogger) bool
- func (olc *OCILnetConfigurator) VerifyLnetConfiguration(logger *zap.SugaredLogger, interfacesInLustreSubnet []NetInterface, ...) error
- type Parameter
- type Util
- func (u *Util) GetAvailableDomainInNodeLabel(fullAD string) string
- func (u *Util) LoadNodeMetadataFromApiServer(ctx context.Context, k kubernetes.Interface, nodeID string, ...) error
- func (u *Util) LookupNodeID(k kubernetes.Interface, nodeName string) (string, error)
- func (u *Util) WaitForKubeApiServerToBeReachableWithContext(ctx context.Context, k kubernetes.Interface, backOffCap time.Duration)
- func (u *Util) WaitForPathToExist(path string, maxRetries int) bool
- type VolumeLocks
Constants ¶
const ( LOAD_LNET_KERNEL_MODULE_COMMAND = "modprobe lnet" CONFIGURE_LNET_KERNEL_SERVICE_COMMAND = "lnetctl lnet configure" SHOW_CONFIGURED_LNET = "lnetctl net show --net %s" DELETE_LNET_INTERFACE = "lnetctl net del --net %s" CONFIGURE_LNET_INTERFACE = "lnetctl net add --net %s --if %s --peer-timeout 180 --peer-credits 120 --credits 1024" LCTL_SET_PARAM = "lctl set_param %s=%s" LFS_VERSION_COMMAND = "lfs --version" )
const ( // minimumVolumeSizeInBytes is used to validate that the user is not trying // to create a volume that is smaller than what we support MinimumVolumeSizeInBytes int64 = 50 * client.GiB // maximumVolumeSizeInBytes is used to validate that the user is not trying // to create a volume that is larger than what we support MaximumVolumeSizeInBytes int64 = 32 * client.TiB // Block Volume Performance Units VpusPerGB = "vpusPerGB" LowCostPerformanceOption = 0 BalancedPerformanceOption = 10 HigherPerformanceOption = 20 MaxUltraHighPerformanceOption = 120 InTransitEncryptionPackageName = "oci-fss-utils" FIPS_ENABLED_FILE_PATH = "/host/proc/sys/crypto/fips_enabled" CAT_COMMAND = "cat" RPM_COMMAND = "rpm-host" LabelIpFamilyPreferred = "oci.oraclecloud.com/ip-family-preferred" LabelIpFamilyIpv4 = "oci.oraclecloud.com/ip-family-ipv4" LabelIpFamilyIpv6 = "oci.oraclecloud.com/ip-family-ipv6" IscsiIpv6Prefix = "fd00:00c1::" Ipv6Stack = "IPv6" Ipv4Stack = "IPv4" // For Raw Block Volumes, the name of the bind-mounted file inside StagingTargetPath RawBlockStagingFile = "mountfile" AvailabilityDomainLabel = "csi-ipv6-full-ad-name" )
Variables ¶
var ( DiskByPathPatternPV = `/dev/disk/by-path/pci-\w{4}:\w{2}:\w{2}\.\d+-scsi-\d+:\d+:\d+:\d+$` DiskByPathPatternISCSI = `/dev/disk/by-path/ip-[[?\w\.\:]+]?:\d+-iscsi-[\w\.\-:]+-lun-\d+$` )
Functions ¶
func ConvertIscsiIpFromIpv4ToIpv6 ¶ added in v1.28.2
func CreateFilePath ¶ added in v1.28.2
func CreateFilePath(logger *zap.SugaredLogger, path string) error
Creates a file on the specified path after creating the containing directory
func ExtractBlockVolumePerformanceLevel ¶ added in v1.19.12
Extracts the vpusPerGB as int64 from given string input
func ExtractISCSIInformation ¶
func ExtractStorage ¶
func ExtractStorage(capRange *csi.CapacityRange) (int64, error)
extractStorage extracts the storage size in bytes from the given capacity range. If the capacity range is not satisfied it returns the default volume size. If the capacity range is below or above supported sizes, it returns an error.
func FormatBytes ¶
func FormatValidIp ¶ added in v1.28.2
func FormatValidIpStackInK8SConvention ¶ added in v1.28.2
func GetBlockSizeBytes ¶ added in v1.24.0
func GetBlockSizeBytes(logger *zap.SugaredLogger, devicePath string) (int64, error)
func GetIsFeatureEnabledFromEnv ¶ added in v1.26.4
func GetIsFeatureEnabledFromEnv(logger *zap.SugaredLogger, featureName string, defaultValue bool) bool
func GetKubeClient ¶
func GetKubeClient(logger *zap.SugaredLogger, master, kubeconfig string) *kubernetes.Clientset
func GetPathForBlock ¶ added in v1.28.2
Get the staging target filepath inside the given stagingTargetPath, to be used for raw block volume support
func IsDualStackSubnet ¶ added in v1.28.2
func IsFipsEnabled ¶ added in v1.24.0
func IsInTransitEncryptionPackageInstalled ¶ added in v1.24.0
func IsIpv4SingleStackSubnet ¶ added in v1.28.2
func IsIpv6SingleStackNode ¶ added in v1.29.2
func IsIpv6SingleStackNode(nodeMetadata *NodeMetadata) bool
func IsIpv6SingleStackSubnet ¶ added in v1.28.2
func IsValidIpFamilyPresentInClusterIpFamily ¶ added in v1.28.2
func LoadCSIConfigFromConfigMap ¶ added in v1.30.2
func LoadCSIConfigFromConfigMap(csiConfig *CSIConfig, k kubernetes.Interface, configMapName string, logger *zap.SugaredLogger)
func RoundUpMinSize ¶
func RoundUpMinSize() int64
func RoundUpSize ¶
func ValidateDNSName ¶ added in v1.28.2
func ValidateFsType ¶
func ValidateFsType(logger *zap.SugaredLogger, fsType string) string
func ValidateLustreParameters ¶ added in v1.30.2
func ValidateLustreParameters(logger *zap.SugaredLogger, lustreParamsJson string) error
func ValidateLustreVolumeId ¶ added in v1.28.2
ValidateLustreVolumeId takes lustreVolumeId as input and returns if its valid or not along with lnetLabel Ex. volume handle : 10.112.10.6@tcp1:/fsname
volume handle : <MGS NID>[:<MGS NID>]:/<fsname>
Types ¶
type CSIConfig ¶ added in v1.30.2
type CSIConfig struct { Lustre *DriverConfig `yaml:"lustre"` IsLoaded bool }
CSIConfig represents the structure of the ConfigMap data.
type DriverConfig ¶ added in v1.30.2
type DriverConfig struct { SkipNodeUnstage bool `yaml:"skipNodeUnstage"` SkipLustreParameters bool `yaml:"skipLustreParameters"` }
DriverConfig represents driver-specific configurations.
type FSSVolumeHandler ¶ added in v1.24.1
type FSSVolumeHandler struct { FilesystemOcid string MountTargetIPAddress string FsExportPath string }
func ValidateFssId ¶ added in v1.24.1
func ValidateFssId(id string) *FSSVolumeHandler
type LnetConfigurator ¶ added in v1.30.2
type LnetConfigurator interface { GetNetInterfacesInSubnet(subnetCIDR string) ([]NetInterface, error) IsLustreClientPackagesInstalled(logger *zap.SugaredLogger) bool GetLnetInfoByLnetLabel(lnetLabel string) (NetInfo, error) ConfigureLnet(logger *zap.SugaredLogger, ifaces []NetInterface, lnetLabel string, netInfo NetInfo) error VerifyLnetConfiguration(logger *zap.SugaredLogger, ifaces []NetInterface, lnetLabel string, netInfo NetInfo, err error) error ExecuteCommandOnWorkerNode(args ...string) (string, error) }
type LnetService ¶ added in v1.30.2
type LnetService struct {
Configurator LnetConfigurator
}
func NewLnetService ¶ added in v1.30.2
func NewLnetService() *LnetService
func (*LnetService) ApplyLustreParameters ¶ added in v1.30.2
func (ls *LnetService) ApplyLustreParameters(logger *zap.SugaredLogger, lustreParamsJson string) error
func (*LnetService) IsLnetActive ¶ added in v1.30.2
func (ls *LnetService) IsLnetActive(logger *zap.SugaredLogger, lnetLabel string) bool
IsLnetActive takes lnetLabel (ex. tcp0, tcp1) as input and tries to check if at leaset one lnet interface is active to consider lnet as active. It returns true when active lnet interface is identified else returns false singling down lnet.
func (*LnetService) SetupLnet ¶ added in v1.30.2
func (ls *LnetService) SetupLnet(logger *zap.SugaredLogger, lustreSubnetCIDR string, lnetLabel string) error
type NetInterface ¶ added in v1.28.2
type NodeMetadata ¶ added in v1.30.2
type OCILnetConfigurator ¶ added in v1.30.2
type OCILnetConfigurator struct{}
func (*OCILnetConfigurator) ConfigureLnet ¶ added in v1.30.2
func (olc *OCILnetConfigurator) ConfigureLnet(logger *zap.SugaredLogger, interfacesInLustreSubnet []NetInterface, lnetLabel string, netInfo NetInfo) error
func (*OCILnetConfigurator) ExecuteCommandOnWorkerNode ¶ added in v1.30.2
func (olc *OCILnetConfigurator) ExecuteCommandOnWorkerNode(args ...string) (string, error)
func (*OCILnetConfigurator) GetLnetInfoByLnetLabel ¶ added in v1.30.2
func (olc *OCILnetConfigurator) GetLnetInfoByLnetLabel(lnetLabel string) (NetInfo, error)
func (*OCILnetConfigurator) GetNetInterfacesInSubnet ¶ added in v1.30.2
func (olc *OCILnetConfigurator) GetNetInterfacesInSubnet(subnetCIDR string) ([]NetInterface, error)
func (*OCILnetConfigurator) IsLustreClientPackagesInstalled ¶ added in v1.30.2
func (olc *OCILnetConfigurator) IsLustreClientPackagesInstalled(logger *zap.SugaredLogger) bool
func (*OCILnetConfigurator) VerifyLnetConfiguration ¶ added in v1.30.2
func (olc *OCILnetConfigurator) VerifyLnetConfiguration(logger *zap.SugaredLogger, interfacesInLustreSubnet []NetInterface, lnetLabel string, netInfo NetInfo, err error) error
type Util ¶
type Util struct {
Logger *zap.SugaredLogger
}
Util interface
func (*Util) GetAvailableDomainInNodeLabel ¶
convert "zkJl:US-ASHBURN-AD-1" to "US-ASHBURN-AD-1"
func (*Util) LoadNodeMetadataFromApiServer ¶ added in v1.30.2
func (u *Util) LoadNodeMetadataFromApiServer(ctx context.Context, k kubernetes.Interface, nodeID string, nodeMetadata *NodeMetadata) error
func (*Util) LookupNodeID ¶
func (*Util) WaitForKubeApiServerToBeReachableWithContext ¶ added in v1.30.2
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
func NewVolumeLocks ¶
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶
func (vl *VolumeLocks) TryAcquire(volumeID string) bool