Documentation
¶
Index ¶
- Variables
- type Cleanup
- type CleanupOnStartup
- type CycleDetector
- type DeschedulingsPipelineController
- func (c *DeschedulingsPipelineController) CreateDeschedulingsPeriodically(ctx context.Context)
- func (c *DeschedulingsPipelineController) InitPipeline(steps []v1alpha1.Step) (Pipeline, error)
- func (c *DeschedulingsPipelineController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (c *DeschedulingsPipelineController) SetupWithManager(mgr ctrl.Manager) error
- type Executor
- type Monitor
- type NovaAPI
- type Pipeline
- type Step
- type StepMonitor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // This error is returned from the step at any time when the step should be skipped. ErrStepSkipped = errors.New("step skipped") )
Functions ¶
This section is empty.
Types ¶
type Cleanup ¶
type Cleanup struct {
// Client for the kubernetes API.
client.Client
// Kubernetes scheme to use for the deschedulings.
Scheme *runtime.Scheme
}
Removes old deschedulings.
type CleanupOnStartup ¶
type CleanupOnStartup struct{ *Cleanup }
type CycleDetector ¶
type CycleDetector interface {
// Filter descheduling decisions to avoid cycles.
Filter(ctx context.Context, decisions []plugins.Decision) ([]plugins.Decision, error)
}
func NewCycleDetector ¶
func NewCycleDetector(novaAPI NovaAPI) CycleDetector
type DeschedulingsPipelineController ¶
type DeschedulingsPipelineController struct {
// Toolbox shared between all pipeline controllers.
lib.BasePipelineController[Pipeline]
// Database to pass down to all steps.
DB db.DB
// Monitor to pass down to all pipelines.
Monitor Monitor
// Config for the scheduling operator.
Conf conf.Config
// Cycle detector to avoid descheduling loops.
CycleDetector CycleDetector
}
The deschedulings pipeline controller is responsible for periodically running the descheduling pipeline and creating descheduling resources based on the selections made.
Additionally, the controller watches for pipeline and step changes to reconfigure the pipelines as needed.
func (*DeschedulingsPipelineController) CreateDeschedulingsPeriodically ¶
func (c *DeschedulingsPipelineController) CreateDeschedulingsPeriodically(ctx context.Context)
func (*DeschedulingsPipelineController) InitPipeline ¶
func (c *DeschedulingsPipelineController) InitPipeline(steps []v1alpha1.Step) (Pipeline, error)
The base controller will delegate the pipeline creation down to this method.
func (*DeschedulingsPipelineController) SetupWithManager ¶
func (c *DeschedulingsPipelineController) SetupWithManager(mgr ctrl.Manager) error
type Executor ¶
type Executor struct {
// Client for the kubernetes API.
client.Client
// Kubernetes scheme to use for the deschedulings.
Scheme *runtime.Scheme
// Nova API to execute the descheduling operations.
NovaAPI NovaAPI
// Configuration for the descheduler.
Conf conf.Config
// Monitor for tracking the descheduler execution.
Monitor Monitor
}
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func NewPipelineMonitor ¶
func NewPipelineMonitor() Monitor
func (*Monitor) Collect ¶
func (m *Monitor) Collect(ch chan<- prometheus.Metric)
func (*Monitor) Describe ¶
func (m *Monitor) Describe(ch chan<- *prometheus.Desc)
type NovaAPI ¶
type NovaAPI interface {
// Initialize the Nova API with the Keystone authentication.
Init(ctx context.Context)
// Get a server by ID.
Get(ctx context.Context, id string) (server, error)
// Live migrate a server to a new host (doesnt wait for it to complete).
LiveMigrate(ctx context.Context, id string) error
// Get migrations for a server by ID.
GetServerMigrations(ctx context.Context, id string) ([]migration, error)
}
func NewNovaAPI ¶
func NewNovaAPI(keystoneAPI keystone.KeystoneAPI) NovaAPI
type Pipeline ¶
type Pipeline struct {
// Kubernetes client to create descheduling resources.
client.Client
// Cycle detector to avoid cycles in descheduling.
CycleDetector CycleDetector
// Monitor to use for tracking the pipeline.
Monitor Monitor
// contains filtered or unexported fields
}
type Step ¶
type Step interface {
// Get the VMs on their current hosts that should be considered for descheduling.
Run() ([]plugins.Decision, error)
// Get the name of this step, used for identification in config, logs, metrics, etc.
GetName() string
// Configure the step with a database and options.
Init(db db.DB, opts conf.RawOpts) error
}
type StepMonitor ¶
type StepMonitor struct {
// contains filtered or unexported fields
}
func (StepMonitor) GetName ¶
func (m StepMonitor) GetName() string
Get the name of the step being monitored.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.