capacity

package
v0.0.0-...-e625038 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// ReconcileInterval is how often the controller probes the scheduler and updates CRDs.
	ReconcileInterval metav1.Duration `json:"capacityReconcileInterval"`

	// TotalPipeline is the scheduler pipeline used for the empty-state probe.
	// This pipeline should ignore current VM allocations (e.g. kvm-report-capacity).
	TotalPipeline string `json:"capacityTotalPipeline"`

	// PlaceablePipeline is the scheduler pipeline used for the current-state probe.
	// This pipeline considers current VM allocations to determine remaining placement capacity.
	PlaceablePipeline string `json:"capacityPlaceablePipeline"`

	// SchedulerURL is the endpoint of the nova external scheduler.
	SchedulerURL string `json:"schedulerURL"`
}

Config holds configuration for the capacity controller.

func DefaultConfig

func DefaultConfig() Config

func (*Config) ApplyDefaults

func (c *Config) ApplyDefaults()

ApplyDefaults fills in any unset values with defaults.

type Controller

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

Controller reconciles FlavorGroupCapacity CRDs on a fixed interval. For each (flavor group × AZ) pair it probes all flavors in the group and updates the CRD status.

func NewController

func NewController(c client.Client, config Config) *Controller

func (*Controller) Start

func (c *Controller) Start(ctx context.Context) error

Start runs the periodic reconcile loop. Implements manager.Runnable.

type Monitor

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

Monitor provides Prometheus metrics for FlavorGroupCapacity CRDs. It implements prometheus.Collector and reads CRD status on each Collect call.

func NewMonitor

func NewMonitor(c client.Client) Monitor

NewMonitor creates a new Monitor that reads FlavorGroupCapacity CRDs.

func (*Monitor) Collect

func (m *Monitor) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector — lists all FlavorGroupCapacity CRDs and exports gauges.

func (*Monitor) Describe

func (m *Monitor) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector.

Jump to

Keyboard shortcuts

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