controllers

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EtcdClusterMachines

func EtcdClusterMachines(clusterName, etcdClusterName string) func(machine *clusterv1.Machine) bool

EtcdClusterMachines returns a filter to find all etcd machines for a cluster, regardless of ownership.

func EtcdLabelsForCluster

func EtcdLabelsForCluster(clusterName string, etcdClusterName string) map[string]string

ControlPlaneLabelsForCluster returns a set of labels to add to a control plane machine for this specific cluster.

func EtcdMachinesSelectorForCluster

func EtcdMachinesSelectorForCluster(clusterName, etcdClusterName string) labels.Selector

EtcdMachinesSelectorForCluster returns the label selector necessary to get etcd machines for a given cluster.

func MatchesEtcdadmClusterConfiguration

func MatchesEtcdadmClusterConfiguration(infraConfigs map[string]*unstructured.Unstructured, machineConfigs map[string]*etcdbpv1alpha3.EtcdadmConfig, ec *etcdv1.EtcdadmCluster) func(machine *clusterv1.Machine) bool

MatchesEtcdadmClusterConfiguration returns a filter to find all machines that matches with EtcdadmCluster config and do not require any rollout. Etcd version and extra params, and infrastructure template need to be equivalent.

func MatchesEtcdadmConfig

func MatchesEtcdadmConfig(machineConfigs map[string]*etcdbpv1alpha3.EtcdadmConfig, ec *etcdv1.EtcdadmCluster) collections.Func

MatchesEtcdadmConfig checks if machine's EtcdadmConfigSpec is equivalent with EtcdadmCluster's spec

func MatchesTemplateClonedFrom

func MatchesTemplateClonedFrom(infraConfigs map[string]*unstructured.Unstructured, ec *etcdv1.EtcdadmCluster) collections.Func

MatchesTemplateClonedFrom returns a filter to find all machines that match a given EtcdadmCluster's infra template.

Types

type EtcdPlane

type EtcdPlane struct {
	EC       *etcdv1.EtcdadmCluster
	Cluster  *clusterv1.Cluster
	Machines collections.FilterableMachineCollection
	// contains filtered or unexported fields
}

func (*EtcdPlane) FailureDomainWithMostMachines

func (ep *EtcdPlane) FailureDomainWithMostMachines(machines collections.FilterableMachineCollection) *string

All functions related to failureDomains follow the same logic as KCP's failureDomain implementation, to leverage existing methods FailureDomainWithMostMachines returns a fd which has the most machines on it.

func (*EtcdPlane) FailureDomains

func (ep *EtcdPlane) FailureDomains() clusterv1.FailureDomains

FailureDomains returns a slice of failure domain objects synced from the infrastructure provider into Cluster.Status.

func (*EtcdPlane) MachineInFailureDomainWithMostMachines

func (ep *EtcdPlane) MachineInFailureDomainWithMostMachines(machines collections.FilterableMachineCollection) (*clusterv1.Machine, error)

MachineInFailureDomainWithMostMachines returns the first matching failure domain with machines that has the most control-plane machines on it.

func (*EtcdPlane) MachineWithDeleteAnnotation

MachineWithDeleteAnnotation returns a machine that has been annotated with DeleteMachineAnnotation key.

func (*EtcdPlane) MachinesNeedingRollout

func (ep *EtcdPlane) MachinesNeedingRollout() collections.FilterableMachineCollection

MachinesNeedingRollout return a list of machines that need to be rolled out.

func (*EtcdPlane) NewestUpToDateMachine added in v0.1.1

func (ep *EtcdPlane) NewestUpToDateMachine() *clusterv1.Machine

func (*EtcdPlane) NextFailureDomainForScaleUp

func (ep *EtcdPlane) NextFailureDomainForScaleUp() *string

NextFailureDomainForScaleUp returns the failure domain with the fewest number of up-to-date machines.

func (*EtcdPlane) UpToDateMachines

func (ep *EtcdPlane) UpToDateMachines() collections.FilterableMachineCollection

UpToDateMachines returns the machines that are up to date with the control plane's configuration and therefore do not require rollout.

type EtcdadmClusterReconciler

type EtcdadmClusterReconciler struct {
	client.Client

	Log    logr.Logger
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

EtcdadmClusterReconciler reconciles a EtcdadmCluster object

func (*EtcdadmClusterReconciler) ClusterToEtcdadmCluster

func (r *EtcdadmClusterReconciler) ClusterToEtcdadmCluster(o handler.MapObject) []ctrl.Request

ClusterToEtcdadmCluster is a handler.ToRequestsFunc to be used to enqueue requests for reconciliation for EtcdadmCluster based on updates to a Cluster.

func (*EtcdadmClusterReconciler) Reconcile

func (r *EtcdadmClusterReconciler) Reconcile(req ctrl.Request) (res ctrl.Result, reterr error)

func (*EtcdadmClusterReconciler) SetupWithManager

func (r *EtcdadmClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, done <-chan struct{}) error

Jump to

Keyboard shortcuts

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