controller

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package controller implements Kubernetes controllers for NstanceCluster, NstanceMachine, NstanceMachinePool, and on-demand Pods.

Index

Constants

View Source
const (
	NstanceMachinePoolFinalizer = "nstancemachinepool.infrastructure.cluster.x-k8s.io/finalizer"

	// ConditionTypeReady is the condition type for pool readiness.
	ConditionTypeReady = "Ready"

	// ConditionReasonInvalid indicates the pool configuration is invalid.
	ConditionReasonInvalid = "Invalid"

	// ConditionReasonDuplicateGroup indicates another pool already uses this group.
	ConditionReasonDuplicateGroup = "DuplicateGroup"

	// ConditionReasonReconciling indicates the pool is being reconciled.
	ConditionReasonReconciling = "Reconciling"

	// ConditionReasonReconciled indicates the pool was successfully reconciled.
	ConditionReasonReconciled = "Reconciled"
)
View Source
const (
	// Event reasons
	EventReasonSyncSucceeded          = "SyncSucceeded"
	EventReasonShardUnreachable       = "ShardUnreachable"
	EventReasonProviderError          = "ProviderError"
	EventReasonConfigValidationFailed = "ConfigValidationFailed"
	EventReasonDeleteSucceeded        = "DeleteSucceeded"
	EventReasonDeleteFailed           = "DeleteFailed"
)
View Source
const (
	OnDemandGroupAnnotation        = "nstance.dev/on-demand-group"
	OnDemandInstanceTypeAnnotation = "nstance.dev/on-demand-instance-type"
	OnDemandPodFinalizer           = "ondemandpod.infrastructure.cluster.x-k8s.io/finalizer"
)
View Source
const (
	NstanceMachineFinalizer = "nstancemachine.infrastructure.cluster.x-k8s.io/finalizer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NstanceClusterReconciler

type NstanceClusterReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

NstanceClusterReconciler reconciles an NstanceCluster object. Its sole job is to mark the cluster infrastructure as provisioned, so that the Cluster API controllers can function as intended. We do not have any other functionality for NstanceCluster objects since Nstance manages infrastructure at the pool/machine level.

func (*NstanceClusterReconciler) Reconcile

Reconcile ensures the NstanceCluster is marked as provisioned and ready.

func (*NstanceClusterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type NstanceMachinePoolReconciler

type NstanceMachinePoolReconciler struct {
	client.Client
	Scheme       *runtime.Scheme
	ConnProvider *connection.Provider
	// contains filtered or unexported fields
}

NstanceMachinePoolReconciler reconciles a NstanceMachinePool object

func (*NstanceMachinePoolReconciler) Reconcile

Reconcile handles NstanceMachinePool reconciliation

func (*NstanceMachinePoolReconciler) SetClusterName

func (r *NstanceMachinePoolReconciler) SetClusterName(name string)

SetClusterName sets the CAPI cluster name. Called by the leader manager after loading operator configuration.

func (*NstanceMachinePoolReconciler) SetSyncManager

func (r *NstanceMachinePoolReconciler) SetSyncManager(mgr *sync.Manager)

SetSyncManager sets the sync manager. Called by the leader manager after the sync manager is created.

func (*NstanceMachinePoolReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type NstanceMachineReconciler

type NstanceMachineReconciler struct {
	client.Client
	Scheme       *runtime.Scheme
	ConnProvider *connection.Provider
}

NstanceMachineReconciler reconciles a NstanceMachine object

func (*NstanceMachineReconciler) Reconcile

Reconcile handles NstanceMachine reconciliation

func (*NstanceMachineReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type NstanceShardGroupReconciler

type NstanceShardGroupReconciler struct {
	client.Client
	Scheme       *runtime.Scheme
	ConnProvider *connection.Provider
	Recorder     record.EventRecorder
}

NstanceShardGroupReconciler reconciles a NstanceShardGroup object

func (*NstanceShardGroupReconciler) Reconcile

Reconcile handles NstanceShardGroup reconciliation. This is a thin controller - when spec.size changes, it calls UpsertGroup on the shard and updates conditions based on the response.

func (*NstanceShardGroupReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type OnDemandPodReconciler

type OnDemandPodReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

OnDemandPodReconciler reconciles Pods with on-demand annotations

func (*OnDemandPodReconciler) Reconcile

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

Reconcile handles on-demand pod reconciliation

func (*OnDemandPodReconciler) SetupWithManager

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