Documentation
¶
Index ¶
- Variables
- type Config
- type MachinePipelineRequest
- func (r MachinePipelineRequest) GetPipeline() string
- func (r MachinePipelineRequest) GetSubjects() []string
- func (r MachinePipelineRequest) GetTraceLogArgs() []slog.Attr
- func (r MachinePipelineRequest) GetWeights() map[string]float64
- func (r MachinePipelineRequest) WithPipeline(pipeline string) scheduling.PipelineRequest
- type MachineScheduler
- type MachineSchedulerConfig
- type MachineSchedulerPipelineConfig
- type MachineSchedulerStepConfig
- type MachineStep
- type NoopFilter
- type SchedulerConfig
Constants ¶
This section is empty.
Variables ¶
var SupportedSteps = map[string]func() MachineStep{ "noop": func() MachineStep { return &NoopFilter{} }, }
Configuration of steps supported by the scheduling. The steps actually used by the scheduler are defined through the configuration file.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
SchedulerConfig `json:"scheduler"`
// Config needed by the library scheduler pipeline.
MonitoringConfig libconf.MonitoringConfig `json:"monitoring"`
MQTTConfig libconf.MQTTConfig `json:"mqtt"`
DBConfig libconf.DBConfig `json:"db"`
}
type MachinePipelineRequest ¶
type MachinePipelineRequest struct {
// The available machine pools.
Pools []v1alpha1.MachinePool `json:"pools"`
// The name of the pipeline to execute.
// By default the required pipeline with the name "default" will be used.
Pipeline string `json:"pipeline"`
}
func (MachinePipelineRequest) GetPipeline ¶
func (r MachinePipelineRequest) GetPipeline() string
func (MachinePipelineRequest) GetSubjects ¶
func (r MachinePipelineRequest) GetSubjects() []string
func (MachinePipelineRequest) GetTraceLogArgs ¶
func (r MachinePipelineRequest) GetTraceLogArgs() []slog.Attr
func (MachinePipelineRequest) GetWeights ¶
func (r MachinePipelineRequest) GetWeights() map[string]float64
func (MachinePipelineRequest) WithPipeline ¶
func (r MachinePipelineRequest) WithPipeline(pipeline string) scheduling.PipelineRequest
type MachineScheduler ¶
type MachineScheduler struct {
// Available pipelines by their name.
Pipelines map[string]scheduling.Pipeline[MachinePipelineRequest]
// Kubernetes client to manage/fetch resources.
client.Client
// Scheme for the Kubernetes client.
Scheme *runtime.Scheme
}
func (*MachineScheduler) Reconcile ¶
Called by the kubernetes apiserver to handle new or updated Machine resources.
func (*MachineScheduler) SetupWithManager ¶
func (s *MachineScheduler) SetupWithManager(mgr manager.Manager) error
type MachineSchedulerConfig ¶
type MachineSchedulerConfig struct {
// Pipelines in this scheduler.
Pipelines []MachineSchedulerPipelineConfig `json:"pipelines"`
}
type MachineSchedulerPipelineConfig ¶
type MachineSchedulerPipelineConfig struct {
// Scheduler step plugins by their name.
Plugins []MachineSchedulerStepConfig `json:"plugins"`
// The name of this scheduler pipeline.
// The name is used to distinguish and route between multiple pipelines.
Name string `json:"name"`
}
type MachineSchedulerStepConfig ¶
type MachineSchedulerStepConfig = libconf.SchedulerStepConfig[struct{}]
type MachineStep ¶
type MachineStep = scheduling.Step[MachinePipelineRequest]
type NoopFilter ¶
type NoopFilter struct {
Alias string
}
Just a filter that does nothing and lets all candidates through.
func (NoopFilter) GetName ¶
func (NoopFilter) GetName() string
Get the name of this step. The name is used to identify the step in metrics, config, logs, and more. Should be something like: "my_cool_scheduler_step".
func (NoopFilter) Run ¶
func (NoopFilter) Run(traceLog *slog.Logger, request MachinePipelineRequest) (*scheduling.StepResult, error)
Run this step of the scheduling pipeline. Return a map of keys to activation values. Important: keys that are not in the map are considered as filtered out. Provide a traceLog that contains the global request id and should be used to log the step's execution.
type SchedulerConfig ¶
type SchedulerConfig struct {
// Configuration for the machines scheduler pipeline (IronCore).
Machines MachineSchedulerConfig `json:"machines"`
}
Configuration for the scheduler module.