Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller implements the SyncReconciler contoller interface, deleting nodes in StorageOS when they have been detected as deleted in Kubernetes.
func NewController ¶
func NewController(api NodeDeleter, log logr.Logger) (*Controller, error)
NewController returns a Controller that implements node garbage collection in StorageOS.
func (Controller) Delete ¶
Delete receives a k8s object that's been deleted and calls the StorageOS api to remove it from management.
func (Controller) List ¶
func (c Controller) List(ctx context.Context) ([]types.NamespacedName, error)
List returns a list of nodes known to StorageOS, as NamespacedNames. This is used for garbage collection and can be expensive. The garbage collector is run in a separate goroutine periodically, not affecting the main reconciliation control-loop.
type NodeDeleter ¶
type NodeDeleter interface { DeleteNode(ctx context.Context, key client.ObjectKey) error ListNodes(ctx context.Context) ([]client.Object, error) }
NodeDeleter provides access to removing nodes from StorageOS.
type Predicate ¶
type Predicate struct { predicate.IgnoreFuncs // contains filtered or unexported fields }
Predicate filters events before enqueuing the keys. Ignore all but Delete events, and then filter out events from non-StorageOS nodes.
type Reconciler ¶
type Reconciler struct { client.Client objectv1.Reconciler // contains filtered or unexported fields }
Reconciler reconciles a Node object by deleting the StorageOS node object when the corresponding Kubernetes node is deleted.
func NewReconciler ¶
func NewReconciler(api NodeDeleter, k8s client.Client, gcDelay time.Duration, gcInterval time.Duration) *Reconciler
NewReconciler returns a new Node delete reconciler.
The gcInterval 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.