controller

package
v0.0.0-...-c951766 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (s *MachineScheduler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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 NoopFilter

type NoopFilter struct {
	Alias string
}

Just a filter that does nothing and lets all candidates through.

func (NoopFilter) GetAlias

func (NoopFilter) GetAlias() string

Get the alias of this step.

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) Init

func (f *NoopFilter) Init(alias string, db db.DB, opts conf.RawOpts) error

func (NoopFilter) Run

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL