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." )
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 ¶
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 ¶
+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)
Click to show internal directories.
Click to hide internal directories.