controller

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterReconciler

type ClusterReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Version  string
	Recorder events.EventRecorder
}

ClusterReconciler reconciles a Cluster object. It ensures that the Talos secrets bundle and talosconfig client configuration are created and kept in sync, and tracks the overall cluster readiness state based on Machine conditions.

The controller is intentionally kept thin: it orchestrates the reconciliation flow, while the actual resource synchronization logic resides in internal/cluster/.

func (*ClusterReconciler) Reconcile

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

Reconcile is the main loop for the Cluster controller. Flow: Fetch -> Reconcile Secrets -> Reconcile Talosconfig -> Update Status.

Deletion is handled by Kubernetes garbage collection: Secret resources are created with OwnerReferences pointing to the Cluster, so they are automatically cascade-deleted when the Cluster is removed.

func (*ClusterReconciler) SetupWithManager

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

SetupWithManager registers the controller with the Manager.

type MachineReconciler

type MachineReconciler struct {
	client.Client
	Scheme       *runtime.Scheme
	Version      string
	Recorder     events.EventRecorder
	Bootstrapper cluster.Bootstrapper
}

MachineReconciler reconciles a Machine object. It generates Talos machine configs, patches BareMetalHost resources with the Talos image and bootstrap data, and triggers the initial Talos bootstrap on the designated bootstrap node.

Unlike the tenant-operator (which uses pure OwnerReference GC), the Machine controller requires a finalizer because BareMetalHost is an external resource that must be explicitly cleaned up on deletion.

func (*MachineReconciler) Reconcile

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

Reconcile is the main loop for the Machine controller. Flow: Fetch -> Fetch Cluster -> Handle Deletion -> Reconcile Resources -> Reconcile Bootstrap -> Update Status.

func (*MachineReconciler) SetupWithManager

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

SetupWithManager registers the controller with the Manager.

Jump to

Keyboard shortcuts

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