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 ¶
- func DecideTargetReplicasByBehavior(behavior *autoscalingv2.HorizontalPodAutoscalerBehavior, currentReplicas int32, ...) int32
- func DecideTargetReplicasByScalingStrategy(decisionType string, predictedReplicas []int32) int32
- func GetLongestPolicyPeriod(scalingRules *autoscalingv2.HPAScalingRules) int32
- func PruneTimestampedReplicasToWindow(timestampedReplicas []jamiethompsonmev1alpha1.TimestampedReplicas, ...) []jamiethompsonmev1alpha1.TimestampedReplicas
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 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.
Click to show internal directories.
Click to hide internal directories.