context

package
v0.0.0-...-5ae08a9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 16 Imported by: 41

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewResourceLimiterFromAutoscalingOptions

func NewResourceLimiterFromAutoscalingOptions(options config.AutoscalingOptions) *cloudprovider.ResourceLimiter

NewResourceLimiterFromAutoscalingOptions creates new instance of cloudprovider.ResourceLimiter reading limits from AutoscalingOptions struct.

Types

type AutoscalingContext

type AutoscalingContext struct {
	// Options to customize how autoscaling works
	config.AutoscalingOptions
	// Kubernetes API clients.
	AutoscalingKubeClients
	// CloudProvider used in CA.
	CloudProvider cloudprovider.CloudProvider
	// TODO(kgolab) - move away too as it's not config
	// PredicateChecker to check if a pod can fit into a node.
	PredicateChecker predicatechecker.PredicateChecker
	// ClusterSnapshot denotes cluster snapshot used for predicate checking.
	ClusterSnapshot clustersnapshot.ClusterSnapshot
	// ExpanderStrategy is the strategy used to choose which node group to expand when scaling up
	ExpanderStrategy expander.Strategy
	// ProcessorCallbacks is interface defining extra callback methods which can be called by processors used in extension points.
	ProcessorCallbacks processor_callbacks.ProcessorCallbacks
	// DebuggingSnapshotter is the interface for capturing the debugging snapshot
	DebuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
	// ScaleDownActuator is the interface for draining and deleting nodes
	ScaleDownActuator scaledown.Actuator
	// RemainingPdbTracker tracks the remaining pod disruption budget
	RemainingPdbTracker pdb.RemainingPdbTracker
	// ClusterStateRegistry tracks the health of the node groups and pending scale-ups and scale-downs
	ClusterStateRegistry *clusterstate.ClusterStateRegistry
	//ProvisionRequstScaleUpMode indicates whether ClusterAutoscaler tries to accommodate ProvisioningRequest in current scale up iteration.
	ProvisioningRequestScaleUpMode bool
}

AutoscalingContext contains user-configurable constant and configuration-related objects passed to scale up/scale down functions.

func NewAutoscalingContext

func NewAutoscalingContext(
	options config.AutoscalingOptions,
	predicateChecker predicatechecker.PredicateChecker,
	clusterSnapshot clustersnapshot.ClusterSnapshot,
	autoscalingKubeClients *AutoscalingKubeClients,
	cloudProvider cloudprovider.CloudProvider,
	expanderStrategy expander.Strategy,
	processorCallbacks processor_callbacks.ProcessorCallbacks,
	debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter,
	remainingPdbTracker pdb.RemainingPdbTracker,
	clusterStateRegistry *clusterstate.ClusterStateRegistry,
) *AutoscalingContext

NewAutoscalingContext returns an autoscaling context from all the necessary parameters passed via arguments

type AutoscalingKubeClients

type AutoscalingKubeClients struct {
	// Listers.
	kube_util.ListerRegistry
	// ClientSet interface.
	ClientSet kube_client.Interface
	// Recorder for recording events.
	Recorder kube_record.EventRecorder
	// LogRecorder can be used to collect log messages to expose via Events on some central object.
	LogRecorder *utils.LogEventRecorder
}

AutoscalingKubeClients contains all Kubernetes API clients, including listers and event recorders.

func NewAutoscalingKubeClients

func NewAutoscalingKubeClients(opts config.AutoscalingOptions, kubeClient kube_client.Interface, informerFactory informers.SharedInformerFactory) *AutoscalingKubeClients

NewAutoscalingKubeClients builds AutoscalingKubeClients out of basic client.

Jump to

Keyboard shortcuts

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