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 IsIpv6SingleStackSubnet(subnet *core.Subnet) bool
- func IsLnetActive(logger *zap.SugaredLogger, lnetLabel string) bool
- func IsValidIpFamilyPresentInClusterIpFamily(clusterIpFamily string) bool
- func MaxOfInt(a, b int64) int64
- func RoundUpMinSize() int64
- func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64
- func SetupLnet(logger *zap.SugaredLogger, lustreSubnetCIDR string, lnetLabel string) error
- func ValidateDNSName(name string) bool
- func ValidateFsType(logger *zap.SugaredLogger, fsType string) string
- func ValidateLustreVolumeId(lusterVolumeId string) (bool, string)
- type FSSVolumeHandler
- type NetInfo
- type NetInterface
- type NodeIpFamily
- type Util
- func (u *Util) GetAvailableDomainInNodeLabel(fullAD string) string
- func (u *Util) LookupNodeAvailableDomain(k kubernetes.Interface, nodeID string) (string, error)
- func (u *Util) LookupNodeID(k kubernetes.Interface, nodeName string) (string, error)
- func (u *Util) WaitForPathToExist(path string, maxRetries int) bool
- type VolumeLocks
Constants ¶
const ( CHROOT_BASH_COMMAND = "chroot-bash" 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" RPM_PACKAGE_QUERY = "rpm -q %s" DPKG_PACKAGE_QEURY = "dpkg -s %s" )
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" )
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 IsIpv6SingleStackSubnet ¶ added in v1.28.2
func IsLnetActive ¶ added in v1.28.2
func 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 IsValidIpFamilyPresentInClusterIpFamily ¶ added in v1.28.2
func RoundUpMinSize ¶
func RoundUpMinSize() int64
func RoundUpSize ¶
func SetupLnet ¶ added in v1.28.2
func SetupLnet(logger *zap.SugaredLogger, lustreSubnetCIDR string, lnetLabel string) error
func ValidateDNSName ¶ added in v1.28.2
func ValidateFsType ¶
func ValidateFsType(logger *zap.SugaredLogger, fsType string) string
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 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 NetInterface ¶ added in v1.28.2
type NodeIpFamily ¶ added in v1.28.2
func GetNodeIpFamily ¶ added in v1.28.2
func GetNodeIpFamily(k kubernetes.Interface, nodeID string, logger *zap.SugaredLogger) (*NodeIpFamily, 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) LookupNodeAvailableDomain ¶
func (*Util) LookupNodeID ¶
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