autoscalers

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpecWarningTargetWorkloadNotSet                = "Spec.targetWorkload is not set"
	SpecWarningStartAtTimeFormat                   = "startAt is not in the right format, which should be like `12:01`"
	SpecWarningStartAtTimeRequired                 = "spec.triggers.condition.startAt: Required value"
	SpecWarningDurationTimeRequired                = "spec.triggers.condition.duration: Required value"
	SpecWarningReplicasRequired                    = "spec.triggers.condition.replicas: Required value"
	SpecWarningDurationTimeNotInRightFormat        = "spec.triggers.condition.duration: not in the right format"
	SpecWarningSumOfStartAndDurationMoreThan24Hour = "the sum of the start hour and the duration hour has to be less than 24 hours."
)

nolint:golint

View Source
const (
	CronType v1alpha1.TriggerType = "cron"
	CPUType  v1alpha1.TriggerType = "cpu"
)

Variables

View Source
var ReconcileWaitResult = reconcile.Result{RequeueAfter: 30 * time.Second}

ReconcileWaitResult is the time to wait between reconciliation.

Functions

func Setup

func Setup(mgr ctrl.Manager) error

Setup adds a controller that reconciles MetricsTrait.

Types

type AutoscalerReconciler

type AutoscalerReconciler struct {
	client.Client

	Log    logr.Logger
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

AutoscalerReconciler reconciles a Autoscaler object

func (*AutoscalerReconciler) Reconcile

func (r *AutoscalerReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error)

+kubebuilder:rbac:groups=standard.oam.dev,resources=autoscalers,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=standard.oam.dev,resources=autoscalers/status,verbs=get;update;patch

func (*AutoscalerReconciler) SetupWithManager

func (r *AutoscalerReconciler) SetupWithManager(mgr ctrl.Manager) error

type CronTypeCondition

type CronTypeCondition struct {
	// StartAt is the time when the scaler starts, in format `"HHMM"` for example, "08:00"
	StartAt string `json:"startAt,omitempty"`

	// Duration means how long the target scaling will keep, after the time of duration, the scaling will stop
	Duration string `json:"duration,omitempty"`

	// Days means in which days the condition will take effect
	Days string `json:"days,omitempty"`

	// Replicas is the expected replicas
	Replicas string `json:"replicas,omitempty"`

	// Timezone defines the time zone, default to the timezone of the Kubernetes cluster
	Timezone string `json:"timezone,omitempty"`
}

func GetCronTypeCondition

func GetCronTypeCondition(condition map[string]string) (*CronTypeCondition, error)

Jump to

Keyboard shortcuts

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