block

package
v1.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigDirectory

func GetConfigDirectory() string

GetConfigDirectory gets the path to where config files are stored.

func GetConfigPath

func GetConfigPath() string

GetConfigPath gets the path to the OCI API credentials.

func GetDriverDirectory

func GetDriverDirectory() string

GetDriverDirectory gets the ath for the flexvolume driver either from the env or default.

func GetKubeconfigPath

func GetKubeconfigPath() string

GetKubeconfigPath gets the override path of the 'kubeconfig'. This override can be uses to explicitly set the name and location of the kubeconfig file via the OCI_FLEXD_KUBECONFIG_PATH environment variable. If this value is not specified then the default GetConfigDirectory mechanism is used.

Types

type OCIFlexvolumeDriver

type OCIFlexvolumeDriver struct {
	K kubernetes.Interface
	// contains filtered or unexported fields
}

OCIFlexvolumeDriver implements the flexvolume.Driver interface for OCI.

func NewOCIFlexvolumeDriver

func NewOCIFlexvolumeDriver(logger *zap.SugaredLogger) (fvd *OCIFlexvolumeDriver, err error)

NewOCIFlexvolumeDriver creates a new driver

func (OCIFlexvolumeDriver) Attach

Attach initiates the attachment of the given OCI volume to the k8s worker node.

func (OCIFlexvolumeDriver) Detach

func (d OCIFlexvolumeDriver) Detach(logger *zap.SugaredLogger, pvOrVolumeName, nodeName string) flexvolume.DriverStatus

Detach detaches the volume from the worker node.

func (OCIFlexvolumeDriver) Init

Init checks that we have the appropriate credentials and metadata API access on driver initialisation.

func (OCIFlexvolumeDriver) IsAttached

func (d OCIFlexvolumeDriver) IsAttached(logger *zap.SugaredLogger, opts flexvolume.Options, nodeName string) flexvolume.DriverStatus

IsAttached checks whether the volume is attached to the host. TODO(apryde): The documentation states that this is called from the Kubelet and KCM. Implementation requries credentials which won't be present on nodes but I've only ever seen it called by the KCM.

func (OCIFlexvolumeDriver) Mount

Mount is unimplemented as we use the --enable-controller-attach-detach flow and as such mount the drive in MountDevice().

func (OCIFlexvolumeDriver) MountDevice

func (d OCIFlexvolumeDriver) MountDevice(logger *zap.SugaredLogger, mountDir, mountDevice string, opts flexvolume.Options) flexvolume.DriverStatus

MountDevice connects the iSCSI target on the k8s worker node before mounting and (if necessary) formatting the disk.

func (OCIFlexvolumeDriver) Unmount

func (d OCIFlexvolumeDriver) Unmount(logger *zap.SugaredLogger, mountDir string) flexvolume.DriverStatus

Unmount is unimplemented as we use the --enable-controller-attach-detach flow and as such unmount the drive in UnmountDevice().

func (OCIFlexvolumeDriver) UnmountDevice

func (d OCIFlexvolumeDriver) UnmountDevice(logger *zap.SugaredLogger, mountPath string) flexvolume.DriverStatus

UnmountDevice unmounts the disk, logs out the iscsi target, and deletes the iscsi node record.

func (OCIFlexvolumeDriver) WaitForAttach

func (d OCIFlexvolumeDriver) WaitForAttach(mountDevice string, _ flexvolume.Options) flexvolume.DriverStatus

WaitForAttach searches for the the volume attachment created by Attach() and waits for its life cycle state to reach ATTACHED.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL