clusters

package
v0.14.3 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckControlPlaneReady added in v0.12.0

func CheckControlPlaneReady(ctx context.Context, client client.Client, log logr.Logger, cluster *anywherev1.Cluster) (controller.Result, error)

CheckControlPlaneReady is a controller helper to check whether a CAPI cluster CP for an eks-a cluster is ready or not. This is intended to be used from cluster reconcilers due its signature and that it returns controller results with appropriate wait times whenever the cluster is not ready.

func CleanupStatusAfterValidate added in v0.13.0

func CleanupStatusAfterValidate(_ context.Context, _ logr.Logger, spec *cluster.Spec) (controller.Result, error)

CleanupStatusAfterValidate removes errors from the cluster status. Intended to be used as a reconciler phase after all validation phases have been executed.

func ReconcileControlPlane added in v0.13.0

func ReconcileControlPlane(ctx context.Context, c client.Client, cp *ControlPlane) (controller.Result, error)

ReconcileControlPlane orchestrates the ControlPlane reconciliation logic.

func ReconcileWorkers added in v0.13.0

func ReconcileWorkers(ctx context.Context, c client.Client, cluster *clusterv1.Cluster, w *Workers) (controller.Result, error)

ReconcileWorkers orchestrates the worker node reconciliation logic. It takes care of applying all desired objects in the Workers spec and deleting the old MachineDeployments that are not in it.

func ReconcileWorkersForEKSA added in v0.13.0

func ReconcileWorkersForEKSA(ctx context.Context, log logr.Logger, c client.Client, cluster *anywherev1.Cluster, w *Workers) (controller.Result, error)

ReconcileWorkersForEKSA orchestrates the worker node reconciliation logic for a particular EKS-A cluster. It takes care of applying all desired objects in the Workers spec and deleting the old MachineDeployments that are not in it.

Types

type ControlPlane added in v0.13.0

type ControlPlane struct {
	Cluster *clusterv1.Cluster

	// ProviderCluster is the provider-specific resource that holds the details
	// for provisioning the infrastructure, referenced in Cluster.Spec.InfrastructureRef
	ProviderCluster client.Object

	KubeadmControlPlane *controlplanev1.KubeadmControlPlane

	// ControlPlaneMachineTemplate is the provider-specific machine template referenced
	// in KubeadmControlPlane.Spec.MachineTemplate.InfrastructureRef
	ControlPlaneMachineTemplate client.Object

	EtcdCluster *etcdv1.EtcdadmCluster

	// EtcdMachineTemplate is the provider-specific machine template referenced
	// in EtcdCluster.Spec.InfrastructureTemplate
	EtcdMachineTemplate client.Object

	// Other includes any other provider-specific objects that need to be reconciled
	// as part of the control plane.
	Other []client.Object
}

ControlPlane represents a CAPI spec for a kubernetes cluster.

func (*ControlPlane) AllObjects added in v0.13.0

func (cp *ControlPlane) AllObjects() []client.Object

AllObjects returns all the control plane objects.

type IPUniquenessValidator added in v0.13.0

type IPUniquenessValidator interface {
	ValidateControlPlaneIPUniqueness(cluster *anywherev1.Cluster) error
}

IPUniquenessValidator defines an interface for the methods to validate the control plane IP.

type IPValidator added in v0.13.0

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

IPValidator validates control plane IP.

func NewIPValidator added in v0.13.0

func NewIPValidator(ipUniquenessValidator IPUniquenessValidator, client client.Client) *IPValidator

NewIPValidator returns a new NewIPValidator.

func (*IPValidator) ValidateControlPlaneIP added in v0.13.0

func (i *IPValidator) ValidateControlPlaneIP(ctx context.Context, log logr.Logger, spec *cluster.Spec) (controller.Result, error)

ValidateControlPlaneIP only validates IP on cluster creation.

type ProviderClusterReconciler

type ProviderClusterReconciler interface {
	// Reconcile handles the full cluster reconciliation.
	Reconcile(ctx context.Context, log logr.Logger, cluster *anywherev1.Cluster) (controller.Result, error)
	// ReconcileWorkerNodes handles only the worker node reconciliation. Intended to be used on self managed clusters.
	ReconcileWorkerNodes(ctx context.Context, log logr.Logger, cluster *anywherev1.Cluster) (controller.Result, error)
}

ProviderClusterReconciler reconciles a provider specific eks-a cluster.

type ProviderClusterReconcilerRegistry

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

ProviderClusterReconcilerRegistry holds a collection of cluster provider reconcilers and ties them to different provider Datacenter kinds.

func (*ProviderClusterReconcilerRegistry) Get

Get returns ProviderClusterReconciler for a particular Datacenter kind.

type ProviderClusterReconcilerRegistryBuilder

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

ProviderClusterReconcilerRegistryBuilder builds ProviderClusterReconcilerRegistry's.

func NewProviderClusterReconcilerRegistryBuilder

func NewProviderClusterReconcilerRegistryBuilder() *ProviderClusterReconcilerRegistryBuilder

NewProviderClusterReconcilerRegistryBuilder returns a new empty ProviderClusterReconcilerRegistryBuilder.

func (*ProviderClusterReconcilerRegistryBuilder) Add

Add accumulates a pair of datacenter kind a reconciler to be included in the final registry.

func (*ProviderClusterReconcilerRegistryBuilder) Build

Build returns a registry with all the previously added reconcilers.

type WorkerGroup added in v0.13.0

type WorkerGroup struct {
	KubeadmConfigTemplate   *kubeadmv1.KubeadmConfigTemplate
	MachineDeployment       *clusterv1.MachineDeployment
	ProviderMachineTemplate client.Object
}

WorkerGroup represents the CAPI spec for an eks-a worker group.

type Workers added in v0.13.0

type Workers struct {
	Groups []WorkerGroup

	// Other includes any other provider-specific objects that need to be reconciled
	// as part of the worker groups.
	Other []client.Object
}

Workers represents the CAPI spec for an eks-a cluster's workers.

func ToWorkers added in v0.13.0

func ToWorkers[M clusterapi.Object[M]](capiWorkers *clusterapi.Workers[M]) *Workers

ToWorkers converts the generic clusterapi Workers definition to the concrete one defined here. It's just a helper for callers generating workers spec using the clusterapi package.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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