Documentation ¶
Index ¶
- Constants
- Variables
- func IndexField(mgr controllerruntime.Manager) error
- type Controller
- func (c *Controller) ExecutionSpaceExistForCluster(clusterName string) (bool, error)
- func (c *Controller) Reconcile(ctx context.Context, req controllerruntime.Request) (controllerruntime.Result, error)
- func (c *Controller) SetupWithManager(mgr controllerruntime.Manager) error
- func (c *Controller) Start(ctx context.Context) error
- type NoExecuteTaintManager
Constants ¶
const ( // ControllerName is the controller name that will be used when reporting events. ControllerName = "cluster-controller" // MonitorRetrySleepTime is the amount of time the cluster controller that should // sleep between retrying cluster health updates. MonitorRetrySleepTime = 20 * time.Millisecond // HealthUpdateRetry controls the number of retries of writing cluster health update. HealthUpdateRetry = 5 )
const TaintManagerName = "taint-manager"
TaintManagerName is the controller name that will be used for taint management.
Variables ¶
var ( // UnreachableTaintTemplate is the taint for when a cluster becomes unreachable. // Used for taint based eviction. UnreachableTaintTemplate = &corev1.Taint{ Key: clusterv1alpha1.TaintClusterUnreachable, Effect: corev1.TaintEffectNoExecute, } // UnreachableTaintTemplateForSched is the taint for when a cluster becomes unreachable. // Used for taint based schedule. UnreachableTaintTemplateForSched = &corev1.Taint{ Key: clusterv1alpha1.TaintClusterUnreachable, Effect: corev1.TaintEffectNoSchedule, } // NotReadyTaintTemplate is the taint for when a cluster is not ready for executing resources. // Used for taint based eviction. NotReadyTaintTemplate = &corev1.Taint{ Key: clusterv1alpha1.TaintClusterNotReady, Effect: corev1.TaintEffectNoExecute, } // NotReadyTaintTemplateForSched is the taint for when a cluster is not ready for executing resources. // Used for taint based schedule. NotReadyTaintTemplateForSched = &corev1.Taint{ Key: clusterv1alpha1.TaintClusterNotReady, Effect: corev1.TaintEffectNoSchedule, } // TerminatingTaintTemplate is the taint for when a cluster is terminating executing resources. // Used for taint based eviction. TerminatingTaintTemplate = &corev1.Taint{ Key: clusterv1alpha1.TaintClusterTerminating, Effect: corev1.TaintEffectNoExecute, } )
Functions ¶
func IndexField ¶ added in v1.3.0
func IndexField(mgr controllerruntime.Manager) error
IndexField registers Indexer functions to controller manager.
Types ¶
type Controller ¶
type Controller struct { client.Client // used to operate Cluster resources. EventRecorder record.EventRecorder EnableTaintManager bool // ClusterMonitorPeriod represents cluster-controller monitoring period, i.e. how often does // cluster-controller check cluster health signal posted from cluster-status-controller. // This value should be lower than ClusterMonitorGracePeriod. ClusterMonitorPeriod time.Duration // ClusterMonitorGracePeriod represents the grace period after last cluster health probe time. // If it doesn't receive update for this amount of time, it will start posting // "ClusterReady==ConditionUnknown". ClusterMonitorGracePeriod time.Duration // When cluster is just created, e.g. agent bootstrap or cluster join, we give a longer grace period. ClusterStartupGracePeriod time.Duration // FailoverEvictionTimeout represents the grace period for deleting scheduling result on failed clusters. FailoverEvictionTimeout time.Duration ClusterTaintEvictionRetryFrequency time.Duration ExecutionSpaceRetryFrequency time.Duration // contains filtered or unexported fields }
Controller is to sync Cluster.
func (*Controller) ExecutionSpaceExistForCluster ¶ added in v0.10.0
func (c *Controller) ExecutionSpaceExistForCluster(clusterName string) (bool, error)
ExecutionSpaceExistForCluster determine whether the execution space exists in the cluster
func (*Controller) Reconcile ¶
func (c *Controller) 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 (*Controller) SetupWithManager ¶
func (c *Controller) SetupWithManager(mgr controllerruntime.Manager) error
SetupWithManager creates a controller and register to controller manager.
type NoExecuteTaintManager ¶ added in v1.3.0
type NoExecuteTaintManager struct { client.Client // used to operate Cluster resources. EventRecorder record.EventRecorder ClusterTaintEvictionRetryFrequency time.Duration ConcurrentReconciles int // contains filtered or unexported fields }
NoExecuteTaintManager listens to Taint/Toleration changes and is responsible for removing objects from Clusters tainted with NoExecute Taints.
func (*NoExecuteTaintManager) Reconcile ¶ added in v1.3.0
func (tc *NoExecuteTaintManager) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.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 (*NoExecuteTaintManager) SetupWithManager ¶ added in v1.3.0
func (tc *NoExecuteTaintManager) SetupWithManager(mgr controllerruntime.Manager) error
SetupWithManager creates a controller and register to controller manager.