scalebehavior

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package scalebehavior provides functions for managing the scaling behavior of the PHPA. This applies HPA scaling behaviors (downscale stabilization, scale rules), PHPA scaling strategies, and min/max replicas. Much of the code for this package has been directly copied from the Kubernetes source code here: https://github.com/kubernetes/kubernetes/blob/3e26e104bdf9d0dc3c4046d6350b93557c67f3f4/pkg/controller/podautoscaler/horizontal.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecideTargetReplicasByBehavior

func DecideTargetReplicasByBehavior(
	behavior *autoscalingv2.HorizontalPodAutoscalerBehavior, currentReplicas int32, targetReplicas int32,
	minReplicas int32, maxReplicas int32,
	scaleUpReplicaHistory []jamiethompsonmev1alpha1.TimestampedReplicas,
	scaleDownReplicaHistory []jamiethompsonmev1alpha1.TimestampedReplicas,
	scaleUpEventHistory []jamiethompsonmev1alpha1.TimestampedReplicas,
	scaleDownEventHistory []jamiethompsonmev1alpha1.TimestampedReplicas,
	now time.Time) int32

func DecideTargetReplicasByScalingStrategy

func DecideTargetReplicasByScalingStrategy(decisionType string, predictedReplicas []int32) int32

func GetLongestPolicyPeriod

func GetLongestPolicyPeriod(scalingRules *autoscalingv2.HPAScalingRules) int32

returns the longest policy period in seconds from the policies in a set of scaling rules provided

func PruneTimestampedReplicasToWindow

func PruneTimestampedReplicasToWindow(
	timestampedReplicas []jamiethompsonmev1alpha1.TimestampedReplicas, window int32, now time.Time) []jamiethompsonmev1alpha1.TimestampedReplicas

Types

This section is empty.

Jump to

Keyboard shortcuts

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