Documentation
¶
Index ¶
- Constants
- Variables
- type RKE2ConfigReconciler
- func (r *RKE2ConfigReconciler) ClusterToRKE2Configs(ctx context.Context, o client.Object) []ctrl.Request
- func (r *RKE2ConfigReconciler) MachinePoolToBootstrapMapFunc(_ context.Context, o client.Object) []ctrl.Request
- func (r *RKE2ConfigReconciler) MachineToBootstrapMapFunc(_ context.Context, o client.Object) []ctrl.Request
- func (r *RKE2ConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, rerr error)
- func (r *RKE2ConfigReconciler) SetupWithManager(mgr ctrl.Manager, concurrency int) error
- type RKE2InitLock
- type Scope
Constants ¶
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 ¶
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") // ErrVersionNotFound describes the desired K8S version can not be found. ErrVersionNotFound = errors.New("RKE2 version can not be found") )
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 (*Scope) GetDesiredVersion ¶ added in v0.13.0
GetDesiredVersion returns the K8S version associated to the RKE2Config owner.
func (*Scope) HasControlPlaneOwner ¶
HasControlPlaneOwner returns true if the RKE2Config is owned by a Machine which is also a ControlPlane.
func (*Scope) HasMachineOwner ¶ added in v0.13.0
HasMachineOwner returns true if the RKE2Config is owned by a Machine.
func (*Scope) HasMachinePoolOwner ¶ added in v0.13.0
HasMachinePoolOwner returns true if the RKE2Config is owned by a MachinePool.