custom-pod-autoscaler: Index | Files

package scale

import ""

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


Package Files


type Scale Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

Package scale imports 13 packages (graph) and is imported by 3 packages. Updated 2020-04-02. Refresh now. Tools for package owners.