Documentation
¶
Overview ¶
Package controllers contains Cluster API controllers for Tinkerbell.
Index ¶
- Constants
- Variables
- type BaseMachineReconcileContext
- type MachineCreator
- type ReconcileContext
- type TinkerbellClusterReconciler
- type TinkerbellMachineReconciler
- func (tmr *TinkerbellMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (tmr *TinkerbellMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
- func (tmr *TinkerbellMachineReconciler) TinkerbellClusterToTinkerbellMachines(ctx context.Context) handler.MapFunc
Constants ¶
const ( // HardwareOwnerNameLabel is a label set by either CAPT controllers or Tinkerbell controller to indicate // that given hardware takes part of at least one workflow. HardwareOwnerNameLabel = "v1alpha1.tinkerbell.org/ownerName" // HardwareOwnerNamespaceLabel is a label set by either CAPT controllers or Tinkerbell controller to indicate // that given hardware takes part of at least one workflow. HardwareOwnerNamespaceLabel = "v1alpha1.tinkerbell.org/ownerNamespace" // ClusterNameLabel is used to mark Hardware as assigned controlplane machine. ClusterNameLabel = "v1alpha1.tinkerbell.org/clusterName" // ClusterNamespaceLabel is used to mark in which Namespace hardware is used. ClusterNamespaceLabel = "v1alpha1.tinkerbell.org/clusterNamespace" // KubernetesAPIPort is a port used by Tinkerbell clusters for Kubernetes API. KubernetesAPIPort = 6443 )
Variables ¶
var ( // ErrMachineVersionEmpty is the error returned when Version is not set on the parent Machine. ErrMachineVersionEmpty = fmt.Errorf("machine version is empty") // ErrConfigurationNil is the error returned when TinkerbellMachineReconciler or TinkerbellClusterReconciler is nil. ErrConfigurationNil = fmt.Errorf("configuration is nil") // ErrMissingClient is the error returned when TinkerbellMachineReconciler or TinkerbellClusterReconciler do // not have a Client configured. ErrMissingClient = fmt.Errorf("client is nil") // ErrMissingBootstrapDataSecretValueKey is the error returned when the Secret referenced for bootstrap data // is missing the value key. ErrMissingBootstrapDataSecretValueKey = fmt.Errorf("retrieving bootstrap data: secret value key is missing") // ErrBootstrapUserDataEmpty is the error returned when the referenced bootstrap data is empty. ErrBootstrapUserDataEmpty = fmt.Errorf("received bootstrap user data is empty") )
var ( // ErrNoHardwareAvailable is the error returned when there is no hardware available for provisioning. ErrNoHardwareAvailable = fmt.Errorf("no hardware available") // ErrHardwareIsNil is the error returned when the given hardware resource is nil. ErrHardwareIsNil = fmt.Errorf("given Hardware object is nil") // ErrHardwareMissingInterfaces is the error returned when the referenced hardware does not have any // network interfaces defined. ErrHardwareMissingInterfaces = fmt.Errorf("hardware has no interfaces defined") // ErrHardwareFirstInterfaceNotDHCP is the error returned when the referenced hardware does not have it's // first network interface configured for DHCP. ErrHardwareFirstInterfaceNotDHCP = fmt.Errorf("hardware's first interface has no DHCP address defined") // ErrHardwareFirstInterfaceDHCPMissingIP is the error returned when the referenced hardware does not have a // DHCP IP address assigned for it's first interface. ErrHardwareFirstInterfaceDHCPMissingIP = fmt.Errorf("hardware's first interface has no DHCP IP address defined") // ErrClusterNotReady is returned when trying to reconcile prior to the Cluster resource being ready. ErrClusterNotReady = fmt.Errorf("cluster resource not ready") // ErrControlPlaneEndpointNotSet is returned when trying to reconcile when the ControlPlane Endpoint is not defined. ErrControlPlaneEndpointNotSet = fmt.Errorf("controlplane endpoint is not set") )
var ErrHardwareMissingDiskConfiguration = fmt.Errorf("disk configuration is required")
ErrHardwareMissingDiskConfiguration is returned when the referenced hardware is missing disk configuration.
Functions ¶
This section is empty.
Types ¶
type BaseMachineReconcileContext ¶
type BaseMachineReconcileContext interface { MachineScheduledForDeletion() bool DeleteMachineWithDependencies() error IntoMachineReconcileContext() (ReconcileContext, error) Log() logr.Logger }
BaseMachineReconcileContext is an interface allowing basic machine reconciliation which involves either object removal or further processing using MachineReconcileContext interface.
type MachineCreator ¶
type MachineCreator interface { // Template related functions. CreateTemplate(ctx context.Context, name, data string) (string, error) // Workflow related functions. CreateWorkflow(ctx context.Context, templateID, hardware string) (string, error) // Hardware related functions. HardwareIDByIP(ctx context.Context, ip string) (string, error) GetHardwareIP(ctx context.Context, id string) (string, error) NextAvailableHardwareID(ctx context.Context) (string, error) HardwareAvailable(ctx context.Context, id string) (bool, error) }
MachineCreator is a subset of tinkerbellCluster used by machineReconcileContext.
type ReconcileContext ¶
type ReconcileContext interface {
Reconcile() error
}
ReconcileContext describes functionality required for reconciling Machine or Cluster object into Tinkerbell Kubernetes node.
type TinkerbellClusterReconciler ¶
TinkerbellClusterReconciler implements Reconciler interface.
func (*TinkerbellClusterReconciler) Reconcile ¶
func (tcr *TinkerbellClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile ensures state of Tinkerbell clusters.
func (*TinkerbellClusterReconciler) SetupWithManager ¶
func (tcr *TinkerbellClusterReconciler) SetupWithManager( ctx context.Context, mgr ctrl.Manager, options controller.Options, ) error
SetupWithManager configures reconciler with a given manager.
type TinkerbellMachineReconciler ¶
TinkerbellMachineReconciler implements Reconciler interface by managing Tinkerbell machines.
func (*TinkerbellMachineReconciler) Reconcile ¶
func (tmr *TinkerbellMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile ensures that all Tinkerbell machines are aligned with a given spec.
func (*TinkerbellMachineReconciler) SetupWithManager ¶
func (tmr *TinkerbellMachineReconciler) SetupWithManager( ctx context.Context, mgr ctrl.Manager, options controller.Options, ) error
SetupWithManager configures reconciler with a given manager.
func (*TinkerbellMachineReconciler) TinkerbellClusterToTinkerbellMachines ¶
func (tmr *TinkerbellMachineReconciler) TinkerbellClusterToTinkerbellMachines(ctx context.Context) handler.MapFunc
TinkerbellClusterToTinkerbellMachines is a handler.ToRequestsFunc to be used to enqeue requests for reconciliation of TinkerbellMachines.