scaling

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package scaling abstracts interactions with the Kubernetes scale API, providing a consistent way to scale resources that are supported by the Custom Pod Autoscaler.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scale

type Scale struct {
	Scaler                   k8sscale.ScalesGetter
	Config                   *config.Config
	Execute                  execute.Executer
	StabilizationEvaluations []TimestampedEvaluation
}

Scale interacts with the Kubernetes API to allow scaling on evaluations

func (*Scale) GetScaleSubResource added in v2.5.0

func (s *Scale) GetScaleSubResource(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error)

GetScaleSubResource returns the scale subresource from the K8s scale API

func (*Scale) Scale

func (s *Scale) Scale(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error)

Scale takes an evaluation and uses it to interact with the Kubernetes scaling API, to scale up/down, or keep the same number of replicas for a resource

type Scaler

type Scaler interface {
	Scale(info scale.Info, scaleResource *autoscalingv1.Scale) (*evaluate.Evaluation, error)
	GetScaleSubResource(apiVersion string, kind string, namespace string, name string) (*autoscalingv1.Scale, error)
}

Scaler abstracts interactions with the Kubernetes scale API, allowing scaling based on an evaluation provided

type TimestampedEvaluation

type TimestampedEvaluation struct {
	Time       time.Time
	Evaluation evaluate.Evaluation
}

TimestampedEvaluation is used to associate an evaluation with a timestamp, used in stabilizing evaluations with the downscale stabilization window

Jump to

Keyboard shortcuts

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