nodegroups

package
v0.0.0-...-7b64836 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncNodeGroupCreationResult

type AsyncNodeGroupCreationResult struct {
	CreationResult           CreateNodeGroupResult
	Error                    errors.AutoscalerError
	CreatedToUpcomingMapping map[string]string
}

AsyncNodeGroupCreationResult captures result of NodeGroupManager.CreateNodeGroupAsync call.

type AsyncNodeGroupInitializer

type AsyncNodeGroupInitializer interface {
	// InitializeNodeGroup initializes asynchronously created node group.
	InitializeNodeGroup(result AsyncNodeGroupCreationResult)
	// GetTargetSize return a size to which the provided node group will be initialized.
	// Note that the node group may be different than the initialized node group, if node group creation
	// triggers creation of multiple node groups.
	GetTargetSize(nodeGroupId string) int64
	// SetTargetSize updates a size to which the provided node group will be initialized.
	// Note that the node group may be different than the initialized node group, if node group creation
	// results in creation of multiple node groups.
	SetTargetSize(nodeGroupId string, size int64)
	// ChangeTargetSize changes by given delta a size to which the provided node goup will be initialized.
	// Delta may be positive or negative value.
	// Note that the node group may be different than the initialized node group, if node group creation
	// results in creation of multiple node groups.
	ChangeTargetSize(nodeGroup string, delta int64)
}

AsyncNodeGroupInitializer is responsible for initializing asynchronously created node groups. In most cases node group initialization should involve scaling up newly created node groups.

type CreateNodeGroupResult

type CreateNodeGroupResult struct {
	// Main created node group, matching the requested node group passed to CreateNodeGroup call
	MainCreatedNodeGroup cloudprovider.NodeGroup

	// List of extra node groups created by CreateNodeGroup call. Non-empty if due manager specific
	// constraints creating one node group requires creating other ones (e.g. matching node group
	// must exist in each zone for multizonal deployments)
	ExtraCreatedNodeGroups []cloudprovider.NodeGroup
}

CreateNodeGroupResult result captures result of successful NodeGroupManager.CreateNodeGroup call.

func (CreateNodeGroupResult) AllCreatedNodeGroups

func (r CreateNodeGroupResult) AllCreatedNodeGroups() []cloudprovider.NodeGroup

AllCreatedNodeGroups returns all created node groups.

type NoOpNodeGroupListProcessor

type NoOpNodeGroupListProcessor struct {
}

NoOpNodeGroupListProcessor is returning pod lists without processing them.

func (*NoOpNodeGroupListProcessor) CleanUp

func (p *NoOpNodeGroupListProcessor) CleanUp()

CleanUp cleans up the processor's internal structures.

func (*NoOpNodeGroupListProcessor) Process

func (p *NoOpNodeGroupListProcessor) Process(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup, nodeInfos map[string]*framework.NodeInfo,
	unschedulablePods []*apiv1.Pod) ([]cloudprovider.NodeGroup, map[string]*framework.NodeInfo, error)

Process processes lists of unschedulable and scheduled pods before scaling of the cluster.

type NoOpNodeGroupManager

type NoOpNodeGroupManager struct {
}

NoOpNodeGroupManager is a no-op implementation of NodeGroupManager. It does not remove any node groups and its CreateNodeGroup method always returns an error. To be used together with NoOpNodeGroupListProcessor.

func (*NoOpNodeGroupManager) CleanUp

func (*NoOpNodeGroupManager) CleanUp()

CleanUp does nothing in NoOpNodeGroupManager

func (*NoOpNodeGroupManager) CreateNodeGroup

CreateNodeGroup always returns internal error. It must not be called on NoOpNodeGroupManager.

func (*NoOpNodeGroupManager) CreateNodeGroupAsync

CreateNodeGroupAsync always returns internal error. It must not be called on NoOpNodeGroupManager.

func (*NoOpNodeGroupManager) RemoveUnneededNodeGroups

func (*NoOpNodeGroupManager) RemoveUnneededNodeGroups(context *context.AutoscalingContext) (removedNodeGroups []cloudprovider.NodeGroup, err error)

RemoveUnneededNodeGroups does nothing in NoOpNodeGroupManager

type NodeGroupListProcessor

type NodeGroupListProcessor interface {
	Process(context *context.AutoscalingContext, nodeGroups []cloudprovider.NodeGroup,
		nodeInfos map[string]*framework.NodeInfo,
		unschedulablePods []*apiv1.Pod) ([]cloudprovider.NodeGroup, map[string]*framework.NodeInfo, error)
	CleanUp()
}

NodeGroupListProcessor processes lists of NodeGroups considered in scale-up.

func NewDefaultNodeGroupListProcessor

func NewDefaultNodeGroupListProcessor() NodeGroupListProcessor

NewDefaultNodeGroupListProcessor creates an instance of NodeGroupListProcessor.

type NodeGroupManager

type NodeGroupManager interface {
	// CreateNodeGroup creates node group and returns all of the results.
	// Creating a node group may result in multiple node group creations, as the behavior is
	// cloud provider dependent.
	CreateNodeGroup(context *context.AutoscalingContext, nodeGroup cloudprovider.NodeGroup) (CreateNodeGroupResult, errors.AutoscalerError)

	// CreateNodeGroupAsync similar to CreateNodeGroup method but creates node group asynchronously.
	// Immediately returns upcoming node group that may be used for scale ups and scale up simulations.
	CreateNodeGroupAsync(context *context.AutoscalingContext, nodeGroup cloudprovider.NodeGroup, nodeGroupInitializer AsyncNodeGroupInitializer) (CreateNodeGroupResult, errors.AutoscalerError)

	RemoveUnneededNodeGroups(context *context.AutoscalingContext) (removedNodeGroups []cloudprovider.NodeGroup, err error)

	CleanUp()
}

NodeGroupManager is responsible for creating/deleting node groups.

func NewDefaultNodeGroupManager

func NewDefaultNodeGroupManager() NodeGroupManager

NewDefaultNodeGroupManager creates an instance of NodeGroupManager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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