strategy

package
v0.0.0-...-82cf001 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Unlicense Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constraints

type Constraints struct {
	MinReplicas                 int32
	MaxReplicas                 int32
	MinResources                ResourcesList
	MaxResources                ResourcesList
	LimitsToRequestsRatioCPU    *inf.Dec
	LimitsToRequestsRatioMemory *inf.Dec
}

Constraints represents the scaling constraints

type ContainerResources

type ContainerResources map[string]Resources

ContainerResources maps a container's name to its allocated resources

type NoOp

type NoOp struct{}

func (*NoOp) MakeDecision

func (n *NoOp) MakeDecision(state *State, learningState []byte) (*ScalingDecision, []byte, error)

type PodMetrics

type PodMetrics struct {
	ResourceUsage ResourcesList
	Resources
}

PodMetrics stores a pod's allocated and average used resources

type Resources

type Resources struct {
	Requests ResourcesList
	Limits   ResourcesList
}

Resources stores a container's resource requests and limits

type ResourcesList

type ResourcesList struct {
	CPU    *inf.Dec
	Memory *inf.Dec
}

ResourcesList stores cpu and memory quantities as decimal values

type ScalingDecision

type ScalingDecision struct {
	Description string
	Replicas    int32
	ContainerResources
}

ScalingDecision represents the next desired state

type ScalingStrategy

type ScalingStrategy interface {
	MakeDecision(state *State, learningState []byte) (*ScalingDecision, []byte, error)
}

type State

type State struct {
	Replicas int32
	ContainerResources
	Constraints
	PodMetrics        PodMetrics
	TargetUtilization ResourcesList
}

State represents the current state

Jump to

Keyboard shortcuts

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