hpa

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHPATargetValue added in v0.2.6

func GetHPATargetValue(ctx context.Context, hpa *v2.HorizontalPodAutoscaler, containerName string, k corev1.ResourceName) (int32, error)

GetHPATargetValue gets the target value of the HPA. It looks for the corresponding metric (ContainerResource) and gets the target value.

func GetReplicasRecommendation added in v0.0.18

func GetReplicasRecommendation(recommendations []autoscalingv1beta3.ReplicasRecommendation, now time.Time) (int32, error)

GetReplicasRecommendation finds the corresponding recommendations.

func HasHorizontal added in v0.1.0

func HasHorizontal(tortoise *autoscalingv1beta3.Tortoise) bool

Types

type Service added in v0.0.5

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(
	c client.Client,
	recorder record.EventRecorder,
	replicaReductionFactor float64,
	maximumTargetResourceUtilization,
	tortoiseHPATargetUtilizationMaxIncrease int,
	tortoiseHPATargetUtilizationUpdateInterval time.Duration,
	maximumMinReplica, maximumMaxReplica int32,
	minimumMinReplicas int32,
	externalMetricExclusionRegex string,
) (*Service, error)

func (*Service) ChangeHPAFromTortoiseRecommendation added in v0.0.5

func (c *Service) ChangeHPAFromTortoiseRecommendation(tortoise *autoscalingv1beta3.Tortoise, hpa *v2.HorizontalPodAutoscaler, now time.Time, recordMetrics bool) (*v2.HorizontalPodAutoscaler, *autoscalingv1beta3.Tortoise, error)

func (*Service) CreateHPA added in v0.0.13

func (*Service) DeleteHPACreatedByTortoise added in v0.0.20

func (c *Service) DeleteHPACreatedByTortoise(ctx context.Context, tortoise *autoscalingv1beta3.Tortoise) error

func (*Service) GetHPAOnTortoise added in v0.0.5

func (c *Service) GetHPAOnTortoise(ctx context.Context, tortoise *autoscalingv1beta3.Tortoise) (*v2.HorizontalPodAutoscaler, error)

func (*Service) GetHPAOnTortoiseSpec added in v0.2.0

func (c *Service) GetHPAOnTortoiseSpec(ctx context.Context, tortoise *autoscalingv1beta3.Tortoise) (*v2.HorizontalPodAutoscaler, error)

func (*Service) InitializeHPA added in v0.0.20

func (c *Service) InitializeHPA(ctx context.Context, tortoise *autoscalingv1beta3.Tortoise, replicaNum int32, now time.Time) (*autoscalingv1beta3.Tortoise, error)

func (*Service) RecordHPATargetUtilizationUpdate added in v0.1.0

func (s *Service) RecordHPATargetUtilizationUpdate(tortoise *autoscalingv1beta3.Tortoise, now time.Time) *autoscalingv1beta3.Tortoise

func (*Service) UpdateHPAFromTortoiseRecommendation added in v0.0.5

func (c *Service) UpdateHPAFromTortoiseRecommendation(ctx context.Context, tortoise *autoscalingv1beta3.Tortoise, now time.Time) (*v2.HorizontalPodAutoscaler, *autoscalingv1beta3.Tortoise, error)

func (*Service) UpdateHPASpecFromTortoiseAutoscalingPolicy added in v0.0.37

func (c *Service) UpdateHPASpecFromTortoiseAutoscalingPolicy(
	ctx context.Context,
	tortoise *autoscalingv1beta3.Tortoise,

	givenHPA *v2.HorizontalPodAutoscaler,
	replicaNum int32,
	now time.Time,
) (*autoscalingv1beta3.Tortoise, error)

func (*Service) UpdatingHPATargetUtilizationAllowed added in v0.1.0

func (s *Service) UpdatingHPATargetUtilizationAllowed(tortoise *autoscalingv1beta3.Tortoise, now time.Time) (*autoscalingv1beta3.Tortoise, bool)

Jump to

Keyboard shortcuts

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