controller

package
v0.0.0-...-aff4308 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hypervisor

type Hypervisor struct {
	ID       string `json:"id"`
	Hostname string `json:"hypervisor_hostname"`
	Service  struct {
		Host string `json:"host"`
	} `json:"service"`
	Type string `json:"hypervisor_type"`
}

OpenStack hypervisor model as returned by the Nova API under /os-hypervisors/detail. See: https://docs.openstack.org/api-ref/compute/#list-hypervisors-details

type HypervisorClient

type HypervisorClient interface {
	// Init the client.
	Init(ctx context.Context, client client.Client, conf conf.Config) error
	// List all hypervisors.
	ListHypervisors(ctx context.Context) ([]Hypervisor, error)
}

Client to fetch hypervisor data.

func NewHypervisorClient

func NewHypervisorClient() HypervisorClient

Create a new hypervisor client. By default, this client will fetch hypervisors from the nova API.

type Monitor

type Monitor struct {
	// Client for the kubernetes API.
	client.Client
	// contains filtered or unexported fields
}

Monitor for reservations metrics.

func NewControllerMonitor

func NewControllerMonitor(k8sClient client.Client) Monitor

func (*Monitor) Collect

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

Collect the metrics on-demand and send them to Prometheus.

func (*Monitor) Describe

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

Describe the metrics for Prometheus.

type ReservationReconciler

type ReservationReconciler struct {
	// Client to fetch hypervisors.
	HypervisorClient
	// Client for the kubernetes API.
	client.Client
	// Kubernetes scheme to use for the reservations.
	Scheme *runtime.Scheme
	// Configuration for the controller.
	Conf conf.Config
}

ReservationReconciler reconciles a Reservation object

func (*ReservationReconciler) Reconcile

func (r *ReservationReconciler) 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 (*ReservationReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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