controllers

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 32 Imported by: 1

README

csi-volumegroupsnapshotter Controller

The csi-volumegroupsnapshotter controller processes reconcile requests for VolumeGroupSnapshot events. This README describes the basic controller logic.

Reconcile Logic for VolumeGroupSnapshot Create Event

Reconciliation steps:

  1. Find all PVC instances with volume-group label as defined in pvcLabel attribute in volume group snapshot
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvol0
  namespace: helmtest-vxflexos
  labels:
    volume-group: volumeGroup1
spec:
  accessModes:
  - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 8Gi
  storageClassName: vxflexos
  1. Get volumeHandle for all corresponding PersistentVolume instances for this set of PVCs.
  2. Call CreateVolumeGroupSnapshot() CSI API extension method of CSI driver with list of volume handles and volume group snapshot name.
  3. Once driver responds with list of Snapshot objects create VolumeSnapshot and VolumeSnapshotContent instances for group members in Kubernetes. As a result, VolumeSnapshot and VolumeSnapshotContent instances are created for each snapshot in the group. To associate VolumeSnapshot instances with parent group, these objects are labeled with VolumeGroupSnapshot name.
  4. Update status of VolumeGroupSnapshot to set groupID, creationTime and list of VolumeSnapshot member names.

Reconcile Logic for VolumeGroupSnapshot Delete Event

Reconciliation steps:

  1. Process member VolumeSnapshot instances based on the value of Deletion Policy in volumesnapshotclass that vgs specifies. For Delete call Kubernetes API to delete each VolumeSnapshot instance. Kubernetes will also delete the corresponding VolumeSnapshotContent instance. For Retain keep VolumeSnapshot instances.

CSI Extension for Volume Group Snapshot Operations in Drivers

The CSI extension API is defined here under volumeGroupSnapshot.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DellCsiVolumeGroupSnapshotReconciler

type DellCsiVolumeGroupSnapshotReconciler struct {
	client.Client
	Log           logr.Logger
	VGClient      csidriver.VolumeGroupSnapshot
	Scheme        *runtime.Scheme
	EventRecorder record.EventRecorder
	DriverName    string
	SnapClient    sclient.Interface
}

DellCsiVolumeGroupSnapshotReconciler reconciles a DellCsiVolumeGroupSnapshot object

func (*DellCsiVolumeGroupSnapshotReconciler) GetReference

GetReference returns an ObjectReference which refers to the given object, or an error if the object doesn't follow the conventions that would allow this.

func (*DellCsiVolumeGroupSnapshotReconciler) HandleSnapContentDelete

func (r *DellCsiVolumeGroupSnapshotReconciler) HandleSnapContentDelete(obj interface{})

HandleSnapContentDelete updates VG status based on changes to volumesnapshotcontent

func (*DellCsiVolumeGroupSnapshotReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the DellCsiVolumeGroupSnapshot object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.7.2/pkg/reconcile

func (*DellCsiVolumeGroupSnapshotReconciler) SetupWithManager

func (r *DellCsiVolumeGroupSnapshotReconciler) SetupWithManager(mgr ctrl.Manager, limiter ratelimiter.RateLimiter, maxReconcilers int) error

SetupWithManager sets up the controller with the Manager. watch For DellCsiVolumeGroupSnapshot events

Jump to

Keyboard shortcuts

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