Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMetrics ¶
func RegisterMetrics()
RegisterMetrics ensures that the package metrics are registered.
Types ¶
type LatencyMetric ¶
LatencyMetric observes latency.
var ( // SyncDuration is the latency metric that measures the duration of the // node sync. SyncDuration LatencyMetric = &latencyAdapter{m: syncLatencyHistogram} // SaveDuration is the latency metric that measures the duration of the // node save. SaveDuration LatencyMetric = &latencyAdapter{m: saveLatencyHistogram} // DeleteDuration is the latency metric that measures the duration of the // node delete. DeleteDuration LatencyMetric = &latencyAdapter{m: saveLatencyHistogram} )
type Lister ¶
type Lister interface {
NodeObjects(context.Context) (map[client.ObjectKey]storageos.Object, error)
}
Lister provides access to StorageOS Nodes.
type Reconciler ¶
Reconciler is syncing StorageOS nodes into K8s datastore, by polling it periodically.
func NewReconciler ¶
func NewReconciler( k8s client.Client, api Lister, apiReset chan<- struct{}, apiPollInterval time.Duration, recorder record.EventRecorder) *Reconciler
NewReconciler returns a new node syncer.
func (*Reconciler) SetupWithManager ¶
func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers with the controller manager.
Since this is an external controller, we don't need to register the controller, just add it as a Runnable so that the manager can control startup and shutdown.
func (*Reconciler) Start ¶
func (r *Reconciler) Start(ctx context.Context) error
Start runs the main reconcile loop until the context is cancelled or there is a fatal error. It implements the controller-runtime Runnable interface so that it can be controlled by controller manager.
The reconcile loop spins up a separated routines for polling the API server and sync nodes into K8s datastore.