cluster

package
v1.9.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
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
)
View Source
const TaintManagerName = "taint-manager"

TaintManagerName is the controller name that will be used for taint management.

Variables

View Source
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

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.

func (*Controller) Start added in v0.7.0

func (c *Controller) Start(ctx context.Context) error

Start starts an asynchronous loop that monitors the status of cluster.

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

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.

func (*NoExecuteTaintManager) Start added in v1.3.0

func (tc *NoExecuteTaintManager) Start(ctx context.Context) error

Start starts an asynchronous loop that handle evictions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL