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 // volume sync. SyncDuration LatencyMetric = &latencyAdapter{m: syncLatencyHistogram} // SaveDuration is the latency metric that measures the duration of the // volume save. SaveDuration LatencyMetric = &latencyAdapter{m: saveLatencyHistogram} // DeleteDuration is the latency metric that measures the duration of the // volume delete. DeleteDuration LatencyMetric = &latencyAdapter{m: saveLatencyHistogram} )
type Reconciler ¶
Reconciler is syncing StorageOS volumes 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 volume 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 volumes into K8s datastore.