controllers

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2025 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultRequeueTime is the default requeue time for the controller.
	DefaultRequeueTime = 20 * time.Second
)

Variables

This section is empty.

Functions

func ControlPlaneMachineLabelsForCluster added in v0.14.0

func ControlPlaneMachineLabelsForCluster(rcp *controlplanev1.RKE2ControlPlane, clusterName string) map[string]string

ControlPlaneMachineLabelsForCluster returns a set of labels to add to a control plane machine for this specific cluster.

Types

type RKE2ControlPlaneReconciler

type RKE2ControlPlaneReconciler struct {
	Log logr.Logger
	client.Client
	Scheme *runtime.Scheme

	SecretCachingClient client.Client

	// WatchFilterValue is the label value used to filter events prior to reconciliation.
	WatchFilterValue string
	// contains filtered or unexported fields
}

RKE2ControlPlaneReconciler reconciles a RKE2ControlPlane object.

func (*RKE2ControlPlaneReconciler) ClusterToRKE2ControlPlane

func (r *RKE2ControlPlaneReconciler) ClusterToRKE2ControlPlane(ctx context.Context) handler.MapFunc

ClusterToRKE2ControlPlane is a handler.ToRequestsFunc to be used to enqueue requests for reconciliation for RKE2ControlPlane based on updates to a Cluster.

func (*RKE2ControlPlaneReconciler) GetWorkloadCluster added in v0.5.0

func (r *RKE2ControlPlaneReconciler) GetWorkloadCluster(ctx context.Context, controlPlane *rke2.ControlPlane) (rke2.WorkloadCluster, error)

GetWorkloadCluster builds a cluster object. The cluster comes with an etcd client generator to connect to any etcd pod living on a managed machine.

func (*RKE2ControlPlaneReconciler) Reconcile

func (r *RKE2ControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, reterr 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 (*RKE2ControlPlaneReconciler) SetupWithManager

func (r *RKE2ControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, clientQPS float32, clientBurst, concurrency int) error

SetupWithManager sets up the controller with the Manager.

func (*RKE2ControlPlaneReconciler) UpdateExternalObject added in v0.14.0

func (r *RKE2ControlPlaneReconciler) UpdateExternalObject(
	ctx context.Context,
	obj client.Object,
	rcp *controlplanev1.RKE2ControlPlane,
	cluster *clusterv1.Cluster,
) error

UpdateExternalObject updates the external object with the labels and annotations from RKE2ControlPlane.

func (*RKE2ControlPlaneReconciler) UpdateMachine added in v0.14.0

UpdateMachine updates an existing Machine object for the control plane.

type RemediationData added in v0.15.0

type RemediationData struct {
	// machine is the machine name of the latest machine being remediated.
	Machine string `json:"machine"`

	// timestamp is when last remediation happened. It is represented in RFC3339 form and is in UTC.
	Timestamp metav1.Time `json:"timestamp"`

	// retryCount used to keep track of remediation retry for the last remediated machine.
	// A retry happens when a machine that was created as a replacement for an unhealthy machine also fails.
	RetryCount int `json:"retryCount"`
}

RemediationData struct is used to keep track of information stored in the RemediationInProgressAnnotation in RKE2ControlPlane during remediation and then into the RemediationForAnnotation on the replacement machine once it is created.

func RemediationDataFromAnnotation added in v0.15.0

func RemediationDataFromAnnotation(value string) (*RemediationData, error)

RemediationDataFromAnnotation gets RemediationData from an annotation value.

func (*RemediationData) Marshal added in v0.15.0

func (r *RemediationData) Marshal() (string, error)

Marshal an RemediationData into an annotation value.

func (*RemediationData) ToStatus added in v0.15.0

ToStatus converts a RemediationData into a LastRemediationStatus struct.

Jump to

Keyboard shortcuts

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