controller

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package controller contains implementation of CSI Controller component

Index

Constants

View Source
const (
	RawPartModeKey   = "isPartitioned"
	RawPartModeValue = "true"
)

Parameter key&value to set partitioned mode for block volumes

Variables

This section is empty.

Functions

func NewIdentityServer

func NewIdentityServer(name string, version string) csi.IdentityServer

NewIdentityServer is the creator for defaultIdentityServer struct Receives name of the driver, driver version and readiness state of the driver Returns csi.IdentityServer because defaultIdentityServer struct implements it

Types

type CSIControllerService

type CSIControllerService struct {
	csi.IdentityServer
	grpc_health_v1.HealthServer
	// contains filtered or unexported fields
}

CSIControllerService is the implementation of ControllerServer interface from GO CSI specification

func NewControllerService

func NewControllerService(k8sClient *k8s.KubeClient, logger *logrus.Logger,
	featureConf featureconfig.FeatureChecker) *CSIControllerService

NewControllerService is the constructor for CSIControllerService struct Receives an instance of base.KubeClient and logrus logger Returns an instance of CSIControllerService

func (*CSIControllerService) Check

Check does the health check and changes the status of the server based on drives cache size

func (*CSIControllerService) ControllerExpandVolume

ControllerExpandVolume is the implementation of CSI Spec ControllerExpandVolume. Controller tries to update volume status to Resizing, trigger reconcile and update according AC, After it controller wait for volume to have previous status, in case of Failed status it tries to return AC size back In case of volume size is equal or less than requiredBytes than ControllerExpandVolume does nothing In case of status different from Volume_Ready, Created, Published and Resizing Controller returns error Receives golang context and CSI Spec ControllerExpandVolumeRequest Returns CSI Spec ControllerExpandVolumeResponse or error if something went wrong

func (*CSIControllerService) ControllerGetCapabilities

ControllerGetCapabilities is the implementation of CSI Spec ControllerGetCapabilities. Provides Controller capabilities of CSI driver to k8s CREATE/DELETE Volume and PUBLISH/UNPUBLISH Volume for now. Receives golang context and CSI Spec ControllerGetCapabilitiesRequest Returns CSI Spec ControllerGetCapabilitiesResponse and nil error

func (*CSIControllerService) ControllerGetVolume added in v1.3.0

ControllerGetVolume is not implemented yet

func (*CSIControllerService) ControllerPublishVolume

ControllerPublishVolume is not implemented yet

func (*CSIControllerService) ControllerUnpublishVolume

ControllerUnpublishVolume is not implemented yet

func (*CSIControllerService) CreateSnapshot

CreateSnapshot is not implemented yet

func (*CSIControllerService) CreateVolume

func (c *CSIControllerService) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (retresp *csi.CreateVolumeResponse, reterr error)

CreateVolume is the implementation of CSI Spec CreateVolume. If k8s SC of driver is set to WaitForFirstConsumer then preferred node chosen by k8s Scheduler would be used for Volume otherwise node would be chosen by balanceAC method. k8s StorageClass contains parameters field. This field can contain storage type where the Volume will be based. For example storageType: HDD, storageType: HDDLVG. If this field is not set then storage type would be ANY. Receives golang context and CSI Spec CreateVolumeRequest Returns CSI Spec CreateVolumeResponse or error if something went wrong

func (*CSIControllerService) DeleteSnapshot

DeleteSnapshot is not implemented yet

func (*CSIControllerService) DeleteVolume

DeleteVolume is the implementation of CSI Spec DeleteVolume. This method sets Volume CR's Spec.CSIStatus to Removing. And waits for Volume to be removed by Reconcile loop of appropriate Node. Receives golang context and CSI Spec DeleteVolumeRequest Returns CSI Spec DeleteVolumeResponse or error if something went wrong

func (*CSIControllerService) GetCapacity

GetCapacity is not implemented yet

func (*CSIControllerService) ListSnapshots

ListSnapshots is not implemented yet

func (*CSIControllerService) ListVolumes

ListVolumes is not implemented yet

func (*CSIControllerService) Probe

Probe is the implementation of CSI Spec Probe for IdentityServer. This method checks if CSI driver is ready to serve requests overrides same method from defaultIdentityServer struct TODO need to introduce new liveness probe since node service doesn't discover AvailableCapacity anymore

func (*CSIControllerService) ValidateVolumeCapabilities

ValidateVolumeCapabilities is not implemented yet

func (*CSIControllerService) WaitNodeServices

func (c *CSIControllerService) WaitNodeServices() bool

WaitNodeServices waits for the first ready Node. Node readiness means that all Node containers are in Ready state and corresponding port is open Returns true in case of ready node service and false instead

func (*CSIControllerService) Watch

Watch is used by clients to receive updates when the svc status changes. Watch only dummy implemented just to satisfy the interface.

type NodeID

type NodeID string

NodeID is the type for node hostname

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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