autoscaler

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 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"
)

nolint:golint

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

constants used in autoscaler controller

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 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"`
}

CronTypeCondition defines the cron type for autoscaler

func GetCronTypeCondition

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

GetCronTypeCondition will get condition from map

type Reconciler

type Reconciler struct {
	client.Client

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

Reconciler reconciles a Autoscaler object

func (*Reconciler) Reconcile

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

Reconcile is the main logic for autoscaler controller +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 (*Reconciler) SetupWithManager

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

SetupWithManager will setup with event recorder

Jump to

Keyboard shortcuts

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