scale

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package scale 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                   scale.ScalesGetter
	Config                   *config.Config
	Execute                  execute.Executer
	StabilizationEvaluations []TimestampedEvaluation
}

Scale interacts with the Kubernetes API to allow scaling on evaluations

func (*Scale) Scale

func (s *Scale) Scale(spec Spec) (*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(spec Spec) (*evaluate.Evaluation, error)
}

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

type Spec added in v0.11.0

type Spec struct {
	Evaluation     evaluate.Evaluation                      `json:"evaluation"`
	Resource       metav1.Object                            `json:"resource"`
	ScaleTargetRef *autoscaling.CrossVersionObjectReference `json:"scaleTargetRef"`
	Namespace      string                                   `json:"namespace"`
	MinReplicas    int32                                    `json:"minReplicas"`
	MaxReplicas    int32                                    `json:"maxReplicas"`
	TargetReplicas int32                                    `json:"targetReplicas"`
	RunType        string                                   `json:"runType"`
}

Spec defines information fed into a Scaler in order for it to make decisions as to how to scale

type TimestampedEvaluation added in v0.11.0

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