kkinstance

package
v3.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 49 Imported by: 1

Documentation

Overview

Package kkinstance implements kkinstance controllers.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNodeNotFound signals that a corev1.Node could not be found for the given provider id.
	ErrNodeNotFound = errors.New("cannot find node with matching ProviderID")
)

Functions

This section is empty.

Types

type Locker

type Locker interface {
	Lock(ctx context.Context, cluster *clusterv1.Cluster, kkInstance *infrav1.KKInstance) bool
	Unlock(ctx context.Context, cluster *clusterv1.Cluster) bool
}

Locker is a lock that is used around.

type Mutex

type Mutex struct {
	// contains filtered or unexported fields
}

Mutex uses a ConfigMap to synchronize KKInstance.

func NewMutex

func NewMutex(client client.Client) *Mutex

NewMutex returns a lock that can be held by a KKInstance.

func (*Mutex) Lock

func (m *Mutex) Lock(ctx context.Context, cluster *clusterv1.Cluster, kkInstance *infrav1.KKInstance) bool

Lock allows a control plane node to be the first and only node to run kubeadm init.

func (*Mutex) Unlock

func (m *Mutex) Unlock(ctx context.Context, cluster *clusterv1.Cluster) bool

Unlock releases the lock.

type Reconciler

type Reconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Tracker  *remote.ClusterCacheTracker
	Recorder record.EventRecorder
	Lock     Locker

	WatchFilterValue string
	DataDir          string

	WaitKKInstanceInterval time.Duration
	WaitKKInstanceTimeout  time.Duration
	// contains filtered or unexported fields
}

Reconciler reconciles a KKInstance object

func (*Reconciler) KKClusterToKKInstances

func (r *Reconciler) KKClusterToKKInstances(log logr.Logger) handler.MapFunc

KKClusterToKKInstances is a handler.ToRequestsFunc to be used to enqeue requests for reconciliation of KKInstance.

func (*Reconciler) KKMachineToKKInstanceMapFunc

func (r *Reconciler) KKMachineToKKInstanceMapFunc(log logr.Logger) handler.MapFunc

KKMachineToKKInstanceMapFunc returns a handler.ToRequestsFunc that watches for KKMachine events and returns reconciliation requests for an KKInstance object.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, retErr error)

func (*Reconciler) SetupWithManager

func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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