Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
Controller implements the Sync contoller interface, applying PVC labels to StorageOS volumes.
func NewController ¶
func NewController(k8s client.Client, api VolumeLabeller, scheme *runtime.Scheme, log logr.Logger) (*Controller, error)
NewController returns a Controller that implements PVC label sync in StorageOS.
func (Controller) Diff ¶
Diff takes a list of Kubernets PVC objects and returns them if they exist as volumes within StorageOS but the labels are different.
func (Controller) Ensure ¶
Ensure applies labels set on the k8s PVC to the StorageOS volume.
StorageOS reserved labels are validated and applied first, then the remaining unreserved labels are applied.
Any errors will result in a requeue, with standard back-off retries.
There is no label sync from StorageOS to Kubernetes. This is intentional to ensure a simple flow of desired state set by users in Kubernetes to actual state set on the StorageOS volume.
type Predicate ¶
type Predicate struct { predicate.IgnoreFuncs // contains filtered or unexported fields }
Predicate filters events before enqueuing the keys. Ignore all but Update events, and then filter out events from non-StorageOS PVCs. Trigger a resync when labels have changed.
We don't need to react to PVC create events as PVC labels will be set in the CSI create volume request as params. This is a customization made to the CSI Provisioner.
type Reconciler ¶
type Reconciler struct { client.Client msyncv1.Reconciler // contains filtered or unexported fields }
Reconciler reconciles a PVC by applying labels from the Kubernetes PVC to the StorageOS volume object.
func NewReconciler ¶
func NewReconciler(api VolumeLabeller, k8s client.Client, resyncDelay time.Duration, resyncInterval time.Duration) *Reconciler
NewReconciler returns a new PVC label reconciler.
The resyncInterval determines how often the periodic resync operation should be run.
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager, workers int) error
SetupWithManager registers the controller with the controller manager.