Documentation ¶
Index ¶
- Constants
- func RunCronFederatedHPARule(c *CronFederatedHPAJob)
- type CronFHPAController
- type CronFederatedHPAJob
- type CronHandler
- func (c *CronHandler) AddCronExecutorIfNotExist(cronFHPAKey string)
- func (c *CronHandler) CreateCronJobForExecutor(cronFHPA *autoscalingv1alpha1.CronFederatedHPA, ...) error
- func (c *CronHandler) CronFHPAScaleTargetRefUpdates(cronFHPAKey string, scaleTarget autoscalingv2.CrossVersionObjectReference) bool
- func (c *CronHandler) GetRuleNextExecuteTime(cronFHPA *autoscalingv1alpha1.CronFederatedHPA, ruleName string) (time.Time, error)
- func (c *CronHandler) RuleCronExecutorExists(cronFHPAKey string, ruleName string) (autoscalingv1alpha1.CronFederatedHPARule, bool)
- func (c *CronHandler) StopCronFHPAExecutor(cronFHPAKey string)
- func (c *CronHandler) StopRuleExecutor(cronFHPAKey string, ruleName string)
- type RuleCron
Constants ¶
const (
// ControllerName is the controller name that will be used when reporting events.
ControllerName = "cronfederatedhpa-controller"
)
Variables ¶
This section is empty.
Functions ¶
func RunCronFederatedHPARule ¶
func RunCronFederatedHPARule(c *CronFederatedHPAJob)
Types ¶
type CronFHPAController ¶
type CronFHPAController struct { client.Client // used to operate Cron resources. EventRecorder record.EventRecorder RateLimiterOptions ratelimiterflag.Options CronHandler *CronHandler }
CronFHPAController is used to operate CronFederatedHPA.
func (*CronFHPAController) Reconcile ¶
func (c *CronFHPAController) Reconcile(ctx context.Context, req controllerruntime.Request) (controllerruntime.Result, error)
Reconcile performs a full reconciliation for the object referred to by the Request. The Controller will requeue the Request to be processed again if an error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
func (*CronFHPAController) SetupWithManager ¶
func (c *CronFHPAController) SetupWithManager(mgr controllerruntime.Manager) error
SetupWithManager creates a controller and register to controller manager.
type CronFederatedHPAJob ¶
type CronFederatedHPAJob struct {
// contains filtered or unexported fields
}
func NewCronFederatedHPAJob ¶
func NewCronFederatedHPAJob(client client.Client, eventRecorder record.EventRecorder, scheduler *gocron.Scheduler, cronFHPA *autoscalingv1alpha1.CronFederatedHPA, rule autoscalingv1alpha1.CronFederatedHPARule) *CronFederatedHPAJob
func (*CronFederatedHPAJob) ScaleFHPA ¶
func (c *CronFederatedHPAJob) ScaleFHPA(cronFHPA *autoscalingv1alpha1.CronFederatedHPA) error
func (*CronFederatedHPAJob) ScaleWorkloads ¶
func (c *CronFederatedHPAJob) ScaleWorkloads(cronFHPA *autoscalingv1alpha1.CronFederatedHPA) error
type CronHandler ¶
type CronHandler struct {
// contains filtered or unexported fields
}
func NewCronHandler ¶
func NewCronHandler(client client.Client, eventRecorder record.EventRecorder) *CronHandler
NewCronHandler creates new cron handler
func (*CronHandler) AddCronExecutorIfNotExist ¶
func (c *CronHandler) AddCronExecutorIfNotExist(cronFHPAKey string)
AddCronExecutorIfNotExist creates the executor for CronFederatedHPA if not exist
func (*CronHandler) CreateCronJobForExecutor ¶
func (c *CronHandler) CreateCronJobForExecutor(cronFHPA *autoscalingv1alpha1.CronFederatedHPA, rule autoscalingv1alpha1.CronFederatedHPARule) error
CreateCronJobForExecutor creates the executor for a rule of CronFederatedHPA
func (*CronHandler) CronFHPAScaleTargetRefUpdates ¶
func (c *CronHandler) CronFHPAScaleTargetRefUpdates(cronFHPAKey string, scaleTarget autoscalingv2.CrossVersionObjectReference) bool
CronFHPAScaleTargetRefUpdates checks if the scale target changed
func (*CronHandler) GetRuleNextExecuteTime ¶
func (c *CronHandler) GetRuleNextExecuteTime(cronFHPA *autoscalingv1alpha1.CronFederatedHPA, ruleName string) (time.Time, error)
func (*CronHandler) RuleCronExecutorExists ¶
func (c *CronHandler) RuleCronExecutorExists(cronFHPAKey string, ruleName string) (autoscalingv1alpha1.CronFederatedHPARule, bool)
func (*CronHandler) StopCronFHPAExecutor ¶
func (c *CronHandler) StopCronFHPAExecutor(cronFHPAKey string)
StopCronFHPAExecutor stops the executor for specific CronFederatedHPA
func (*CronHandler) StopRuleExecutor ¶
func (c *CronHandler) StopRuleExecutor(cronFHPAKey string, ruleName string)
StopRuleExecutor stops the executor for specific CronFederatedHPA rule
type RuleCron ¶
type RuleCron struct { *gocron.Scheduler autoscalingv1alpha1.CronFederatedHPARule }