Documentation
¶
Index ¶
- func CleanupNovaDecisionsRegularly(ctx context.Context, client client.Client, conf conf.Config)
- func NewPipeline(steps []v1alpha1.Step, db db.DB, monitor lib.PipelineMonitor) (lib.Pipeline[api.ExternalSchedulerRequest], error)
- type DecisionPipelineController
- func (c *DecisionPipelineController) InitPipeline(steps []v1alpha1.Step) (lib.Pipeline[api.ExternalSchedulerRequest], error)
- func (c *DecisionPipelineController) ProcessNewDecisionFromAPI(ctx context.Context, decision *v1alpha1.Decision) (*v1alpha1.Decision, error)
- func (c *DecisionPipelineController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (c *DecisionPipelineController) SetupWithManager(mgr manager.Manager) error
- type NovaSchedulerOpts
- type NovaSchedulerStepHostCapabilities
- type NovaSchedulerStepHostSelector
- type NovaSchedulerStepScope
- type NovaSchedulerStepSpecScope
- type NovaSchedulerStepSpecSelector
- type NovaStep
- type StepScoper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPipeline ¶
func NewPipeline( steps []v1alpha1.Step, db db.DB, monitor lib.PipelineMonitor, ) (lib.Pipeline[api.ExternalSchedulerRequest], error)
Create a new Nova scheduler pipeline.
Types ¶
type DecisionPipelineController ¶
type DecisionPipelineController struct {
// Toolbox shared between all pipeline controllers.
lib.BasePipelineController[lib.Pipeline[api.ExternalSchedulerRequest]]
// Database to pass down to all steps.
DB db.DB
// Monitor to pass down to all pipelines.
Monitor lib.PipelineMonitor
// Config for the scheduling operator.
Conf conf.Config
// contains filtered or unexported fields
}
The decision pipeline controller takes decision resources containing a placement request spec and runs the scheduling pipeline to make a decision. This decision is then written back to the decision resource status.
Additionally, the controller watches for pipeline and step changes to reconfigure the pipelines as needed.
func (*DecisionPipelineController) InitPipeline ¶
func (c *DecisionPipelineController) InitPipeline(steps []v1alpha1.Step) (lib.Pipeline[api.ExternalSchedulerRequest], error)
The base controller will delegate the pipeline creation down to this method.
func (*DecisionPipelineController) ProcessNewDecisionFromAPI ¶
func (c *DecisionPipelineController) ProcessNewDecisionFromAPI(ctx context.Context, decision *v1alpha1.Decision) (*v1alpha1.Decision, error)
Process the decision from the API. Should create and return the updated decision.
func (*DecisionPipelineController) SetupWithManager ¶
func (c *DecisionPipelineController) SetupWithManager(mgr manager.Manager) error
type NovaSchedulerOpts ¶
type NovaSchedulerOpts struct {
// Configuration of the scope.
Scope NovaSchedulerStepScope `json:"scope,omitempty"`
}
type NovaSchedulerStepHostCapabilities ¶
type NovaSchedulerStepHostCapabilities struct {
// If given, the scheduler step will only be applied to hosts
// that have ONE of the given traits.
AnyOfTraitInfixes []string `json:"anyOfTraitInfixes,omitempty"`
// If given, the scheduler step will only be applied to hosts
// that have ONE of the given hypervisor types.
AnyOfHypervisorTypeInfixes []string `json:"anyOfHypervisorTypeInfixes,omitempty"`
// If given, the scheduler step will only be applied to hosts
// that have ALL of the given traits.
AllOfTraitInfixes []string `json:"allOfTraitInfixes,omitempty"`
// If the selection should be inverted, i.e. the step should be applied to hosts
// that do NOT match the aforementioned criteria.
InvertSelection bool `json:"invertSelection,omitempty"`
}
func (NovaSchedulerStepHostCapabilities) IsUndefined ¶
func (s NovaSchedulerStepHostCapabilities) IsUndefined() bool
type NovaSchedulerStepHostSelector ¶
type NovaSchedulerStepHostSelector struct {
// One of: "trait", "hypervisorType"
Subject string `json:"subject"`
// Selector type, currently only "infix" is supported.
Type string `json:"type,omitempty"`
// Value of the selector (typed to the given type).
Value any `json:"value,omitempty"`
// How the selector should be applied:
// Let A be the previous set of hosts, and B the scoped hosts.
// - "union" means that the scoped hosts are added to the previous set of hosts.
// - "difference" means that the scoped hosts are removed from the previous set of hosts.
// - "intersection" means that the scoped hosts are the only ones that remain in the previous set of hosts.
Operation string `json:"operation,omitempty"`
}
type NovaSchedulerStepScope ¶
type NovaSchedulerStepScope struct {
// Selectors applied to the compute hosts.
HostSelectors []NovaSchedulerStepHostSelector `json:"hostSelectors,omitempty"`
// Selectors applied to the given nova spec.
SpecSelectors []NovaSchedulerStepSpecSelector `json:"specSelectors,omitempty"`
}
Scope that defines which hosts a scheduler step should be applied to. In addition, it also defines the traits for which the step should be applied.
type NovaSchedulerStepSpecScope ¶
type NovaSchedulerStepSpecScope struct {
// If given, the scheduler step will only be applied to specs
// that contain ALL of the following infixes.
AllOfFlavorNameInfixes []string `json:"allOfFlavorNameInfixes,omitempty"`
}
func (NovaSchedulerStepSpecScope) IsUndefined ¶
func (s NovaSchedulerStepSpecScope) IsUndefined() bool
type NovaSchedulerStepSpecSelector ¶
type NovaSchedulerStepSpecSelector struct {
// One of: "flavor", "vmware"
Subject string `json:"subject"`
// Selector type: bool, infix.
Type string `json:"type,omitempty"`
// Value of the selector (typed to the given type).
Value any `json:"value,omitempty"`
// What to do if the selector is matched:
// - "skip" means that the step is skipped.
// - "continue" means that the step is applied.
Action string `json:"action,omitempty"`
}
type StepScoper ¶
type StepScoper struct {
// The wrapped step to scope.
Step scheduling.Step[api.ExternalSchedulerRequest]
// The scope for this step.
Scope NovaSchedulerStepScope
// The database to use for querying host capabilities.
DB db.DB
}
func (*StepScoper) GetName ¶
func (s *StepScoper) GetName() string
Get the name of the wrapped step.
func (*StepScoper) Run ¶
func (s *StepScoper) Run(traceLog *slog.Logger, request api.ExternalSchedulerRequest) (*scheduling.StepResult, error)