controllers

package
v0.4.10-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BootstrapDataNotReady                      = "Bootstrap DataSecretName not yet available"
	CSMachineCreationSuccess                   = "CloudStack instance Created"
	CSMachineCreationFailed                    = "Creating CloudStack machine failed: %s"
	MachineInstanceRunning                     = "Machine instance is Running..."
	MachineInErrorMessage                      = "CloudStackMachine VM in error state. Deleting associated Machine"
	MachineNotReadyMessage                     = "Instance not ready, is %s"
	CSMachineStateCheckerCreationFailed        = "error encountered when creating CloudStackMachineStateChecker"
	CSMachineStateCheckerCreationSuccess       = "CloudStackMachineStateChecker created"
	CSMachineDeletionMessage                   = "Deleting CloudStack Machine %s"
	CSMachineDeletionInstanceIDNotFoundMessage = "Deleting CloudStack Machine %s instanceID not found"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudStackAGReconciliationRunner

type CloudStackAGReconciliationRunner struct {
	*csCtrlrUtils.ReconciliationRunner
	ReconciliationSubject *infrav1.CloudStackAffinityGroup
	FailureDomain         *infrav1.CloudStackFailureDomain
}

CloudStackAGReconciliationRunner is a ReconciliationRunner with extensions specific to CloudStack affinity group reconciliation.

func NewCSAGReconciliationRunner

func NewCSAGReconciliationRunner() *CloudStackAGReconciliationRunner

Initialize a new CloudStackAffinityGroup reconciliation runner with concrete types and initialized member fields.

func (*CloudStackAGReconciliationRunner) Reconcile

func (*CloudStackAGReconciliationRunner) ReconcileDelete

func (r *CloudStackAGReconciliationRunner) ReconcileDelete() (ctrl.Result, error)

type CloudStackAffinityGroupReconciler

type CloudStackAffinityGroupReconciler struct {
	csCtrlrUtils.ReconcilerBase
}

CloudStackAGReconciler is the base reconciler to adapt to k8s.

func (*CloudStackAffinityGroupReconciler) Reconcile

func (reconciler *CloudStackAffinityGroupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*CloudStackAffinityGroupReconciler) SetupWithManager

func (reconciler *CloudStackAffinityGroupReconciler) SetupWithManager(mgr ctrl.Manager, opts controller.Options) error

SetupWithManager sets up the controller with the Manager.

type CloudStackClusterReconciler

type CloudStackClusterReconciler struct {
	csCtrlrUtils.ReconcilerBase
}

CloudStackClusterReconciler is the k8s controller manager's interface to reconcile a CloudStackCluster. This is primarily to adapt to k8s.

func (*CloudStackClusterReconciler) Reconcile

func (reconciler *CloudStackClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (retRes ctrl.Result, retErr error)

Reconcile is the method k8s will call upon a reconciliation request.

func (*CloudStackClusterReconciler) SetupWithManager

func (reconciler *CloudStackClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opts controller.Options) error

Called in main, this registers the cluster reconciler to the CAPI controller manager.

type CloudStackClusterReconciliationRunner

type CloudStackClusterReconciliationRunner struct {
	*csCtrlrUtils.ReconciliationRunner
	FailureDomains        *infrav1.CloudStackFailureDomainList
	ReconciliationSubject *infrav1.CloudStackCluster
}

CloudStackClusterReconciliationRunner is a ReconciliationRunner with extensions specific to CloudStackClusters. The runner does the actual reconciliation.

func NewCSClusterReconciliationRunner

func NewCSClusterReconciliationRunner() *CloudStackClusterReconciliationRunner

Initialize a new CloudStackCluster reconciliation runner with concrete types and initialized member fields.

func (*CloudStackClusterReconciliationRunner) Reconcile

func (r *CloudStackClusterReconciliationRunner) Reconcile() (res ctrl.Result, reterr error)

Reconcile actually reconciles the CloudStackCluster.

func (*CloudStackClusterReconciliationRunner) ReconcileDelete

func (r *CloudStackClusterReconciliationRunner) ReconcileDelete() (ctrl.Result, error)

ReconcileDelete cleans up resources used by the cluster and finally removes the CloudStackCluster's finalizers.

func (*CloudStackClusterReconciliationRunner) SetFailureDomainsStatusMap

func (r *CloudStackClusterReconciliationRunner) SetFailureDomainsStatusMap() (ctrl.Result, error)

SetFailureDomainsStatusMap sets failure domains in CloudStackCluster status to be used for CAPI machine placement.

func (*CloudStackClusterReconciliationRunner) SetReady

SetReady adds a finalizer and sets the cluster status to ready.

func (*CloudStackClusterReconciliationRunner) VerifyFailureDomainCRDs

func (r *CloudStackClusterReconciliationRunner) VerifyFailureDomainCRDs() (ctrl.Result, error)

VerifyFailureDomainCRDs verifies the FailureDomains found match against those requested.

type CloudStackFailureDomainReconciler

type CloudStackFailureDomainReconciler struct {
	csCtrlrUtils.ReconcilerBase
}

CloudStackFailureDomainReconciler is the k8s controller manager's interface to reconcile a CloudStackFailureDomain. This is primarily to adapt to k8s.

func (*CloudStackFailureDomainReconciler) Reconcile

func (reconciler *CloudStackFailureDomainReconciler) Reconcile(ctx context.Context, req ctrl.Request) (retRes ctrl.Result, retErr error)

Reconcile is the method k8s will call upon a reconciliation request.

func (*CloudStackFailureDomainReconciler) SetupWithManager

func (reconciler *CloudStackFailureDomainReconciler) SetupWithManager(mgr ctrl.Manager, opts controller.Options) error

SetupWithManager sets up the controller with the Manager.

type CloudStackFailureDomainReconciliationRunner

type CloudStackFailureDomainReconciliationRunner struct {
	*csCtrlrUtils.ReconciliationRunner
	ReconciliationSubject *infrav1.CloudStackFailureDomain
	IsoNet                *infrav1.CloudStackIsolatedNetwork
	Machines              []infrav1.CloudStackMachine
}

CloudStackFailureDomainReconciliationRunner is a ReconciliationRunner with extensions specific to CloudStackFailureDomains. The runner does the actual reconciliation.

func NewCSFailureDomainReconciliationRunner

func NewCSFailureDomainReconciliationRunner() *CloudStackFailureDomainReconciliationRunner

Initialize a new CloudStackFailureDomain reconciliation runner with concrete types and initialized member fields.

func (*CloudStackFailureDomainReconciliationRunner) ClearMachines

ClearMachines deletes the CAPI machine in FailureDomain.

func (*CloudStackFailureDomainReconciliationRunner) GetAllMachinesInFailureDomain

func (r *CloudStackFailureDomainReconciliationRunner) GetAllMachinesInFailureDomain() (ctrl.Result, error)

GetAllMachinesInFailureDomain returns all cloudstackmachines deployed in this failure domain sorted by name.

func (*CloudStackFailureDomainReconciliationRunner) Reconcile

func (r *CloudStackFailureDomainReconciliationRunner) Reconcile() (retRes ctrl.Result, retErr error)

Reconcile on the ReconciliationRunner actually attempts to modify or create the reconciliation subject.

func (*CloudStackFailureDomainReconciliationRunner) ReconcileDelete

ReconcileDelete on the ReconciliationRunner attempts to delete the reconciliation subject.

func (*CloudStackFailureDomainReconciliationRunner) RemoveFinalizer

RemoveFinalizer just removes the finalizer from the failure domain.

func (*CloudStackFailureDomainReconciliationRunner) RequeueIfClusterNotReady

func (r *CloudStackFailureDomainReconciliationRunner) RequeueIfClusterNotReady() (ctrl.Result, error)

RequeueIfClusterNotReady check cluster to see if there is any rolling update going on.

func (*CloudStackFailureDomainReconciliationRunner) RequeueIfMachineCannotBeRemoved

func (r *CloudStackFailureDomainReconciliationRunner) RequeueIfMachineCannotBeRemoved() (ctrl.Result, error)

RequeueIfMachineCannotBeRemoved checks for each machine to confirm it is not risky to remove it.

type CloudStackIsoNetReconciler

type CloudStackIsoNetReconciler struct {
	csCtrlrUtils.ReconcilerBase
}

CloudStackIsoNetReconciler reconciles a CloudStackZone object

func (*CloudStackIsoNetReconciler) Reconcile

func (reconciler *CloudStackIsoNetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, retErr error)

func (*CloudStackIsoNetReconciler) SetupWithManager

func (reconciler *CloudStackIsoNetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type CloudStackIsoNetReconciliationRunner

type CloudStackIsoNetReconciliationRunner struct {
	*csCtrlrUtils.ReconciliationRunner
	FailureDomain         *infrav1.CloudStackFailureDomain
	ReconciliationSubject *infrav1.CloudStackIsolatedNetwork
}

CloudStackZoneReconciliationRunner is a ReconciliationRunner with extensions specific to CloudStack isolated network reconciliation.

func NewCSIsoNetReconciliationRunner

func NewCSIsoNetReconciliationRunner() *CloudStackIsoNetReconciliationRunner

Initialize a new CloudStackIsoNet reconciliation runner with concrete types and initialized member fields.

func (*CloudStackIsoNetReconciliationRunner) Reconcile

func (r *CloudStackIsoNetReconciliationRunner) Reconcile() (retRes ctrl.Result, retErr error)

func (*CloudStackIsoNetReconciliationRunner) ReconcileDelete

func (r *CloudStackIsoNetReconciliationRunner) ReconcileDelete() (retRes ctrl.Result, retErr error)

type CloudStackMachineReconciler

type CloudStackMachineReconciler struct {
	utils.ReconcilerBase
}

CloudStackMachineReconciler reconciles a CloudStackMachine object

func (*CloudStackMachineReconciler) Reconcile

func (reconciler *CloudStackMachineReconciler) 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 (*CloudStackMachineReconciler) SetupWithManager

func (reconciler *CloudStackMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opts controller.Options) error

SetupWithManager registers the machine reconciler to the CAPI controller manager.

type CloudStackMachineReconciliationRunner

type CloudStackMachineReconciliationRunner struct {
	*utils.ReconciliationRunner
	ReconciliationSubject *infrav1.CloudStackMachine
	CAPIMachine           *clusterv1.Machine
	StateChecker          *infrav1.CloudStackMachineStateChecker
	FailureDomain         *infrav1.CloudStackFailureDomain
	IsoNet                *infrav1.CloudStackIsolatedNetwork
	AffinityGroup         *infrav1.CloudStackAffinityGroup
}

CloudStackMachineReconciliationRunner is a ReconciliationRunner with extensions specific to CloudStack machine reconciliation.

func NewCSMachineReconciliationRunner

func NewCSMachineReconciliationRunner() *CloudStackMachineReconciliationRunner

Initialize a new CloudStackMachine reconciliation runner with concrete types and initialized member fields.

func (*CloudStackMachineReconciliationRunner) AddToLBIfNeeded

func (r *CloudStackMachineReconciliationRunner) AddToLBIfNeeded() (retRes ctrl.Result, reterr error)

AddToLBIfNeeded adds instance to load balancer if it is a control plane in an isolated network.

func (*CloudStackMachineReconciliationRunner) ConsiderAffinity

func (r *CloudStackMachineReconciliationRunner) ConsiderAffinity() (ctrl.Result, error)

ConsiderAffinity sets machine affinity if needed. It also creates or gets an affinity group resource if required and checks it for readiness.

func (*CloudStackMachineReconciliationRunner) DeleteMachineIfFailuredomainNotExist

func (r *CloudStackMachineReconciliationRunner) DeleteMachineIfFailuredomainNotExist() (retRes ctrl.Result, reterr error)

DeleteMachineIfFailuredomainNotExist delete CAPI machine if machine is deployed in a failuredomain that does not exist anymore.

func (*CloudStackMachineReconciliationRunner) GetOrCreateMachineStateChecker

func (r *CloudStackMachineReconciliationRunner) GetOrCreateMachineStateChecker() (retRes ctrl.Result, reterr error)

GetOrCreateMachineStateChecker creates or gets CloudStackMachineStateChecker object.

func (*CloudStackMachineReconciliationRunner) GetOrCreateVMInstance

func (r *CloudStackMachineReconciliationRunner) GetOrCreateVMInstance() (retRes ctrl.Result, reterr error)

GetOrCreateVMInstance gets or creates a VM instance. Implicitly it also fetches its bootstrap secret in order to create said instance.

func (*CloudStackMachineReconciliationRunner) Reconcile

func (r *CloudStackMachineReconciliationRunner) Reconcile() (retRes ctrl.Result, reterr error)

func (*CloudStackMachineReconciliationRunner) ReconcileDelete

func (r *CloudStackMachineReconciliationRunner) ReconcileDelete() (retRes ctrl.Result, reterr error)

func (*CloudStackMachineReconciliationRunner) RequeueIfInstanceNotRunning

func (r *CloudStackMachineReconciliationRunner) RequeueIfInstanceNotRunning() (retRes ctrl.Result, reterr error)

ConfirmVMStatus checks the Instance's status for running state and requeues otherwise.

func (*CloudStackMachineReconciliationRunner) SetFailureDomainOnCSMachine

func (r *CloudStackMachineReconciliationRunner) SetFailureDomainOnCSMachine() (retRes ctrl.Result, reterr error)

SetFailureDomainOnCSMachine sets the failure domain the machine should launch in.

type CloudStackMachineStateCheckerReconciler

type CloudStackMachineStateCheckerReconciler struct {
	csCtrlrUtils.ReconcilerBase
}

CloudStackMachineStateCheckerReconciler reconciles a CloudStackMachineStateChecker object

func (*CloudStackMachineStateCheckerReconciler) Reconcile

func (*CloudStackMachineStateCheckerReconciler) SetupWithManager

func (r *CloudStackMachineStateCheckerReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type CloudStackMachineStateCheckerReconciliationRunner

type CloudStackMachineStateCheckerReconciliationRunner struct {
	*csCtrlrUtils.ReconciliationRunner
	MachineStateCheckers  *infrav1.CloudStackMachineStateCheckerList
	ReconciliationSubject *infrav1.CloudStackMachineStateChecker
	FailureDomain         *infrav1.CloudStackFailureDomain
	CAPIMachine           *clusterv1.Machine
	CSMachine             *infrav1.CloudStackMachine
}

CloudStackMachineStateCheckerReconciliationRunner is a ReconciliationRunner with extensions specific to CloudStack machine state checker reconciliation.

func NewCSMachineStateCheckerReconciliationRunner

func NewCSMachineStateCheckerReconciliationRunner() *CloudStackMachineStateCheckerReconciliationRunner

Initialize a new CloudStackMachineStateChecker reconciliation runner with concrete types and initialized member fields.

func (*CloudStackMachineStateCheckerReconciliationRunner) Reconcile

func (*CloudStackMachineStateCheckerReconciliationRunner) ReconcileDelete

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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