Documentation ¶
Index ¶
Constants ¶
const (
// ControllerName is the controller name that will be used when reporting events.
ControllerName = "cluster-status-controller"
)
const WorkStatusControllerName = "work-status-controller"
WorkStatusControllerName is the controller name that will be used when reporting events.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterStatusController ¶ added in v0.3.0
type ClusterStatusController struct { client.Client // used to operate Cluster resources. KubeClient clientset.Interface EventRecorder record.EventRecorder PredicateFunc predicate.Predicate InformerManager informermanager.MultiClusterInformerManager StopChan <-chan struct{} ClusterClientSetFunc func(string, client.Client, *util.ClientOption) (*util.ClusterClient, error) ClusterDynamicClientSetFunc func(clusterName string, client client.Client) (*util.DynamicClusterClient, error) // ClusterClientOption holds the attributes that should be injected to a Kubernetes client. ClusterClientOption *util.ClientOption // ClusterStatusUpdateFrequency is the frequency that controller computes and report cluster status. ClusterStatusUpdateFrequency metav1.Duration // ClusterLeaseDuration is a duration that candidates for a lease need to wait to force acquire it. // This is measure against time of last observed lease RenewTime. ClusterLeaseDuration metav1.Duration // ClusterLeaseRenewIntervalFraction is a fraction coordinated with ClusterLeaseDuration that // how long the current holder of a lease has last updated the lease. ClusterLeaseRenewIntervalFraction float64 // ClusterLeaseControllers store clusters and their corresponding lease controllers. ClusterLeaseControllers sync.Map ClusterCacheSyncTimeout metav1.Duration }
ClusterStatusController is to sync status of Cluster.
func (*ClusterStatusController) Reconcile ¶ added in v0.3.0
func (c *ClusterStatusController) Reconcile(ctx context.Context, req controllerruntime.Request) (controllerruntime.Result, error)
Reconcile syncs status of the given member cluster. The Controller will requeue the Request to be processed again if an error is non-nil or Result.Requeue is true, otherwise upon completion it will requeue the reconcile key after the duration.
func (*ClusterStatusController) SetupWithManager ¶ added in v0.3.0
func (c *ClusterStatusController) SetupWithManager(mgr controllerruntime.Manager) error
SetupWithManager creates a controller and register to controller manager.
type WorkStatusController ¶ added in v0.4.0
type WorkStatusController struct { client.Client // used to operate Work resources. EventRecorder record.EventRecorder RESTMapper meta.RESTMapper InformerManager informermanager.MultiClusterInformerManager StopChan <-chan struct{} // ConcurrentWorkStatusSyncs is the number of Work status that are allowed to sync concurrently. ConcurrentWorkStatusSyncs int ObjectWatcher objectwatcher.ObjectWatcher PredicateFunc predicate.Predicate ClusterClientSetFunc func(clusterName string, client client.Client) (*util.DynamicClusterClient, error) ClusterCacheSyncTimeout metav1.Duration // contains filtered or unexported fields }
WorkStatusController is to sync status of Work.
func (*WorkStatusController) Reconcile ¶ added in v0.4.0
func (c *WorkStatusController) Reconcile(ctx context.Context, req controllerruntime.Request) (controllerruntime.Result, error)
Reconcile performs a full reconciliation for the object referred to by the Request. The Controller will requeue the Request to be processed again if an error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (*WorkStatusController) RunWorkQueue ¶ added in v0.4.0
func (c *WorkStatusController) RunWorkQueue()
RunWorkQueue initializes worker and run it, worker will process resource asynchronously.
func (*WorkStatusController) SetupWithManager ¶ added in v0.4.0
func (c *WorkStatusController) SetupWithManager(mgr controllerruntime.Manager) error
SetupWithManager creates a controller and register to controller manager.