tortoise

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: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateTortoiseAutoscalingPolicyInStatus added in v0.2.0

func UpdateTortoiseAutoscalingPolicyInStatus(tortoise *v1beta3.Tortoise, hpa *v2.HorizontalPodAutoscaler, now time.Time) *v1beta3.Tortoise

UpdateTortoiseAutoscalingPolicyInStatus updates .status.autoscalingPolicy based on the policy in .spec.autoscalingPolicy, and the existing container names in the workload.

Types

type Service

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

func New

func New(c client.Client, recorder record.EventRecorder, rangeOfMinMaxReplicasRecommendationHour int, timeZone string, tortoiseUpdateInterval time.Duration, gatheringDataDuration string) (*Service, error)

func (*Service) AddFinalizer added in v0.0.20

func (s *Service) AddFinalizer(ctx context.Context, tortoise *v1beta3.Tortoise) (*v1beta3.Tortoise, error)

func (*Service) GetTortoise

func (s *Service) GetTortoise(ctx context.Context, namespacedName types.NamespacedName) (*v1beta3.Tortoise, error)

func (*Service) ListTortoise added in v0.6.1

func (s *Service) ListTortoise(ctx context.Context, namespaceName string) (*v1beta3.TortoiseList, error)

func (*Service) RecordReconciliationFailure added in v0.0.33

func (s *Service) RecordReconciliationFailure(t *v1beta3.Tortoise, err error, now time.Time) *v1beta3.Tortoise

func (*Service) RemoveFinalizer added in v0.0.20

func (s *Service) RemoveFinalizer(ctx context.Context, tortoise *v1beta3.Tortoise) error

func (*Service) ShouldReconcileTortoiseNow

func (s *Service) ShouldReconcileTortoiseNow(tortoise *v1beta3.Tortoise, now time.Time) (bool, time.Duration)

func (*Service) UpdateContainerRecommendationFromVPA added in v0.2.14

func (s *Service) UpdateContainerRecommendationFromVPA(tortoise *v1beta3.Tortoise, vpa *v1.VerticalPodAutoscaler, now time.Time) *v1beta3.Tortoise

func (*Service) UpdateResourceRequest added in v0.7.0

func (c *Service) UpdateResourceRequest(ctx context.Context, tortoise *v1beta3.Tortoise, replica int32, now time.Time) (
	*v1beta3.Tortoise,
	error,
)

UpdateResourceRequest updates pods' resource requests based on the calculated recommendation. Updated ContainerResourceRequests will be used in the next mutating webhook of Pods. It updates ContainerResourceRequests in the status of the Tortoise, when ALL the following conditions are met:

  • UpdateMode is Auto
  • Any of the recommended resource request is increased, OR, all the recommended resource request is decreased, but it's been a while (1h) after the last update.

func (*Service) UpdateTortoisePhase

func (s *Service) UpdateTortoisePhase(tortoise *v1beta3.Tortoise, now time.Time) *v1beta3.Tortoise

func (*Service) UpdateTortoiseStatus

func (s *Service) UpdateTortoiseStatus(ctx context.Context, originalTortoise *v1beta3.Tortoise, now time.Time, timeRecord bool) (*v1beta3.Tortoise, error)

Jump to

Keyboard shortcuts

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