Documentation ¶
Overview ¶
Package controller contains implementation of CSI Controller component
Index ¶
- Constants
- func NewIdentityServer(name string, version string) csi.IdentityServer
- type CSIControllerService
- func (c *CSIControllerService) Check(context.Context, *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
- func (c *CSIControllerService) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (c *CSIControllerService) ControllerGetCapabilities(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (c *CSIControllerService) ControllerGetVolume(_ context.Context, _ *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
- func (c *CSIControllerService) ControllerPublishVolume(_ context.Context, _ *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (c *CSIControllerService) ControllerUnpublishVolume(_ context.Context, _ *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (c *CSIControllerService) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (c *CSIControllerService) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (retresp *csi.CreateVolumeResponse, reterr error)
- func (c *CSIControllerService) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (c *CSIControllerService) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (c *CSIControllerService) GetCapacity(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (c *CSIControllerService) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (c *CSIControllerService) ListVolumes(context.Context, *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (c *CSIControllerService) Probe(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (c *CSIControllerService) ValidateVolumeCapabilities(context.Context, *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- func (c *CSIControllerService) WaitNodeServices() bool
- func (c *CSIControllerService) Watch(*grpc_health_v1.HealthCheckRequest, grpc_health_v1.Health_WatchServer) error
- type NodeID
Constants ¶
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 ¶
func (c *CSIControllerService) Check(context.Context, *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
Check does the health check and changes the status of the server based on drives cache size
func (*CSIControllerService) ControllerExpandVolume ¶
func (c *CSIControllerService) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
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 ¶
func (c *CSIControllerService) ControllerGetCapabilities(context.Context, *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
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
func (c *CSIControllerService) ControllerGetVolume(_ context.Context, _ *csi.ControllerGetVolumeRequest) (*csi.ControllerGetVolumeResponse, error)
ControllerGetVolume is not implemented yet
func (*CSIControllerService) ControllerPublishVolume ¶
func (c *CSIControllerService) ControllerPublishVolume(_ context.Context, _ *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
ControllerPublishVolume is not implemented yet
func (*CSIControllerService) ControllerUnpublishVolume ¶
func (c *CSIControllerService) ControllerUnpublishVolume(_ context.Context, _ *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
ControllerUnpublishVolume is not implemented yet
func (*CSIControllerService) CreateSnapshot ¶
func (c *CSIControllerService) CreateSnapshot(context.Context, *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
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 ¶
func (c *CSIControllerService) DeleteSnapshot(context.Context, *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
DeleteSnapshot is not implemented yet
func (*CSIControllerService) DeleteVolume ¶
func (c *CSIControllerService) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
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 ¶
func (c *CSIControllerService) GetCapacity(context.Context, *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
GetCapacity is not implemented yet
func (*CSIControllerService) ListSnapshots ¶
func (c *CSIControllerService) ListSnapshots(context.Context, *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
ListSnapshots is not implemented yet
func (*CSIControllerService) ListVolumes ¶
func (c *CSIControllerService) ListVolumes(context.Context, *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
ListVolumes is not implemented yet
func (*CSIControllerService) Probe ¶
func (c *CSIControllerService) Probe(context.Context, *csi.ProbeRequest) (*csi.ProbeResponse, error)
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 ¶
func (c *CSIControllerService) ValidateVolumeCapabilities(context.Context, *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
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 ¶
func (c *CSIControllerService) Watch(*grpc_health_v1.HealthCheckRequest, grpc_health_v1.Health_WatchServer) error
Watch is used by clients to receive updates when the svc status changes. Watch only dummy implemented just to satisfy the interface.