scheduledpodscaler

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScaleRule

type ScaleRule struct {
	Range     schedule.Range
	Timezone  *time.Location // must be non-nil
	ScaleSpec ScaleSpec
}

func (*ScaleRule) IsActive added in v0.2.0

func (r *ScaleRule) IsActive(now time.Time) bool

func (*ScaleRule) NextEdge added in v0.2.0

func (r *ScaleRule) NextEdge(now time.Time) time.Time

type ScaleSpec

type ScaleSpec struct {
	Replicas int32
}

type ScaleTarget

type ScaleTarget struct {
	Selectors map[string]string
}

type ScheduledPodScaler

type ScheduledPodScaler struct {
	TypeMeta   metav1.TypeMeta
	ObjectMeta metav1.ObjectMeta

	Spec   Spec
	Status Status
}

type Spec

type Spec struct {
	ScaleTarget      ScaleTarget
	ScaleRules       []ScaleRule
	DefaultScaleSpec ScaleSpec
}

func (*Spec) ComputeDesiredScaleSpec

func (s *Spec) ComputeDesiredScaleSpec(now time.Time) ScaleSpec

ComputeDesiredScaleSpec returns the ScaleSpec corresponding to the current time. This finds the active ScaleRule in order.

func (*Spec) FindNextReconcileTime

func (s *Spec) FindNextReconcileTime(now time.Time) (earliest time.Time)

FindNextReconcileTime returns the next time to reconcile. This finds the earliest ScaleRule in order.

type Status

type Status struct {
	NextReconcileTime time.Time
}

Jump to

Keyboard shortcuts

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