Documentation
¶
Overview ¶
Package controller implements Kubernetes controllers for NstanceCluster, NstanceMachine, NstanceMachinePool, and on-demand Pods.
Index ¶
- Constants
- type NstanceClusterReconciler
- type NstanceMachinePoolReconciler
- func (r *NstanceMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *NstanceMachinePoolReconciler) SetClusterName(name string)
- func (r *NstanceMachinePoolReconciler) SetSyncManager(mgr *sync.Manager)
- func (r *NstanceMachinePoolReconciler) SetupWithManager(mgr ctrl.Manager) error
- type NstanceMachineReconciler
- type NstanceShardGroupReconciler
- type OnDemandPodReconciler
Constants ¶
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" )
const ( // Event reasons EventReasonSyncSucceeded = "SyncSucceeded" EventReasonShardUnreachable = "ShardUnreachable" EventReasonProviderError = "ProviderError" EventReasonConfigValidationFailed = "ConfigValidationFailed" EventReasonDeleteSucceeded = "DeleteSucceeded" EventReasonDeleteFailed = "DeleteFailed" )
const ( OnDemandGroupAnnotation = "nstance.dev/on-demand-group" OnDemandInstanceTypeAnnotation = "nstance.dev/on-demand-instance-type" OnDemandPodFinalizer = "ondemandpod.infrastructure.cluster.x-k8s.io/finalizer" )
const (
NstanceMachineFinalizer = "nstancemachine.infrastructure.cluster.x-k8s.io/finalizer"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NstanceClusterReconciler ¶
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 ¶
func (r *NstanceClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
func (r *NstanceMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
func (r *NstanceMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
func (r *NstanceShardGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
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