nova

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: 29 Imported by: 0

Documentation

Index

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")
)
View Source
var SupportedSteps = []Step{
	&kvm.AvoidHighStealPctStep{},
}

Configuration of steps supported by the descheduler. The steps actually used by the scheduler are defined through the configuration file.

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.

func (*Cleanup) Reconcile

func (r *Cleanup) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*Cleanup) SetupWithManager

func (r *Cleanup) SetupWithManager(mgr ctrl.Manager) error

type CleanupOnStartup

type CleanupOnStartup struct{ *Cleanup }

func (*CleanupOnStartup) Start

func (s *CleanupOnStartup) Start(ctx context.Context) error

Cleanup all old deschedulings on controller startup.

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, config conf.DeschedulerConfig) CycleDetector

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
}

func (*Executor) Reconcile

func (e *Executor) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*Executor) SetupWithManager

func (s *Executor) SetupWithManager(mgr manager.Manager) error

type Monitor

type Monitor struct {
	// contains filtered or unexported fields
}

func NewPipelineMonitor

func NewPipelineMonitor(registry *monitoring.Registry) Monitor

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, conf conf.NovaDeschedulerConfig) NovaAPI

type Pipeline

type Pipeline struct {
	// Client for the kubernetes API.
	client.Client
	// Kubernetes scheme to use for the deschedulings.
	Scheme *runtime.Scheme
	// Configuration for the descheduler.
	Config conf.DeschedulerConfig
	// Nova API to use for the descheduler.
	NovaAPI NovaAPI
	// Cycle detector to avoid cycles in descheduling.
	CycleDetector CycleDetector
	// Monitor to use for tracking the pipeline.
	Monitor Monitor
	// contains filtered or unexported fields
}

func (*Pipeline) CreateDeschedulingsPeriodically

func (p *Pipeline) CreateDeschedulingsPeriodically(ctx context.Context)

func (*Pipeline) Init

func (p *Pipeline) Init(supported []Step, ctx context.Context, db db.DB, config conf.DeschedulerConfig)

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.

func (StepMonitor) Init

func (m StepMonitor) Init(db db.DB, opts conf.RawOpts) error

Initialize the step with the database and options.

func (StepMonitor) Run

func (m StepMonitor) Run() ([]plugins.Decision, error)

Run the step and measure its execution time.

Directories

Path Synopsis
kvm

Jump to

Keyboard shortcuts

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