controllers

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultManifestDirectory is the default directory to store kubernetes manifests that RKE2 will deploy automatically.
	DefaultManifestDirectory string = "/var/lib/rancher/rke2/server/manifests"

	// DefaultRequeueAfter is the default requeue time.
	DefaultRequeueAfter time.Duration = 20 * time.Second
)

Variables

View Source
var (
	// ErrRKE2ConfigNotFound describes the RKE2Config is not found.
	ErrRKE2ConfigNotFound = errors.New("RKE2Config is not found")
	// ErrNoRKE2ConfigOwner describes the RKE2Config has no Machine or MachinePool owner.
	ErrNoRKE2ConfigOwner = errors.New("RKE2Config has no owner")
)

Functions

This section is empty.

Types

type RKE2ConfigReconciler

type RKE2ConfigReconciler struct {
	RKE2InitLock RKE2InitLock
	client.Client
	Scheme *runtime.Scheme
}

RKE2ConfigReconciler reconciles a Rke2Config object.

func (*RKE2ConfigReconciler) ClusterToRKE2Configs added in v0.5.0

func (r *RKE2ConfigReconciler) ClusterToRKE2Configs(ctx context.Context, o client.Object) []ctrl.Request

ClusterToRKE2Configs is a handler.ToRequestsFunc to be used to enqueue requests for reconciliation of RKE2Configs.

func (*RKE2ConfigReconciler) MachinePoolToBootstrapMapFunc added in v0.13.0

func (r *RKE2ConfigReconciler) MachinePoolToBootstrapMapFunc(_ context.Context, o client.Object) []ctrl.Request

MachinePoolToBootstrapMapFunc is a handler.ToRequestsFunc to be used to enqueue request for reconciliation of RKE2Config.

func (*RKE2ConfigReconciler) MachineToBootstrapMapFunc added in v0.5.0

func (r *RKE2ConfigReconciler) MachineToBootstrapMapFunc(_ context.Context, o client.Object) []ctrl.Request

MachineToBootstrapMapFunc is a handler.ToRequestsFunc to be used to enqueue request for reconciliation of RKE2Config.

func (*RKE2ConfigReconciler) Reconcile

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

func (r *RKE2ConfigReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) error

SetupWithManager sets up the controller with the Manager.

type RKE2InitLock

type RKE2InitLock interface {
	Unlock(ctx context.Context, cluster *clusterv1.Cluster) bool
	Lock(ctx context.Context, cluster *clusterv1.Cluster, machine *clusterv1.Machine) bool
}

RKE2InitLock is an interface for locking/unlocking Machine Creation as soon as an Init Process for the Control Plane has been started.

type Scope

type Scope struct {
	Logger       logr.Logger
	Config       *bootstrapv1.RKE2Config
	Machine      *clusterv1.Machine
	MachinePool  *clusterexpv1.MachinePool
	Cluster      *clusterv1.Cluster
	ControlPlane *controlplanev1.RKE2ControlPlane
}

Scope is a scoped struct used during reconciliation.

func NewScope added in v0.13.0

func NewScope(ctx context.Context, req ctrl.Request, client client.Client) (*Scope, error)

NewScope initializes the RKE2Config scope given a new request.

func (*Scope) GetDesiredVersion added in v0.13.0

func (s *Scope) GetDesiredVersion() string

GetDesiredVersion returns the K8S version associated to the RKE2Config owner.

func (*Scope) HasControlPlaneOwner

func (s *Scope) HasControlPlaneOwner() bool

HasControlPlaneOwner returns true if the RKE2Config is owned by a Machine which is also a ControlPlane.

func (*Scope) HasMachineOwner added in v0.13.0

func (s *Scope) HasMachineOwner() bool

HasMachineOwner returns true if the RKE2Config is owned by a Machine.

func (*Scope) HasMachinePoolOwner added in v0.13.0

func (s *Scope) HasMachinePoolOwner() bool

HasMachinePoolOwner returns true if the RKE2Config is owned by a MachinePool.

Jump to

Keyboard shortcuts

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