Documentation
¶
Index ¶
- Variables
- func ControlPlaneLabelsForCluster(clusterName string) map[string]string
- func ControlPlaneLabelsForClusterWithHash(clusterName string, hash string) map[string]string
- func ControlPlaneSelectorForCluster(clusterName string) *metav1.LabelSelector
- func FilterMachines(machines []*clusterv1.Machine, ...) []*clusterv1.Machine
- func HasDeletionTimestamp() func(machine *clusterv1.Machine) bool
- func HasOutdatedConfiguration(configHash string) func(machine *clusterv1.Machine) bool
- func MatchesConfigurationHash(configHash string) func(machine *clusterv1.Machine) bool
- func OlderThan(t *metav1.Time) func(machine *clusterv1.Machine) bool
- func OwnedControlPlaneMachines(controlPlaneName string) func(machine *clusterv1.Machine) bool
- func PickFewest(failureDomains clusterv1.FailureDomains, machines []*clusterv1.Machine) string
- func PickMost(failureDomains clusterv1.FailureDomains, machines []*clusterv1.Machine) string
- type ManagementCluster
- func (m *ManagementCluster) GetEtcdCerts(ctx context.Context, cluster types.NamespacedName) ([]byte, []byte, error)
- func (m *ManagementCluster) GetMachinesForCluster(ctx context.Context, cluster types.NamespacedName, ...) ([]*clusterv1.Machine, error)
- func (m *ManagementCluster) TargetClusterControlPlaneIsHealthy(ctx context.Context, clusterKey types.NamespacedName, controlPlaneName string) error
- func (m *ManagementCluster) TargetClusterEtcdIsHealthy(ctx context.Context, clusterKey types.NamespacedName, controlPlaneName string) error
Constants ¶
This section is empty.
Variables ¶
var Log = klogr.New()
Log is the global logger for the internal package.
Functions ¶
func ControlPlaneLabelsForCluster ¶
ControlPlaneLabelsForCluster returns a set of labels to add to a control plane machine for this specific cluster.
func ControlPlaneLabelsForClusterWithHash ¶
ControlPlaneLabelsForClusterWithHash returns a set of labels to add to a control plane machine for this specific cluster and configuration hash
func ControlPlaneSelectorForCluster ¶
func ControlPlaneSelectorForCluster(clusterName string) *metav1.LabelSelector
ControlPlaneSelectorForCluster returns the label selector necessary to get control plane machines for a given cluster.
func FilterMachines ¶
func FilterMachines(machines []*clusterv1.Machine, filters ...func(machine *clusterv1.Machine) bool) []*clusterv1.Machine
FilterMachines returns a filtered list of machines
func HasDeletionTimestamp ¶
HasDeletionTimestamp returns a MachineFilter function to find all machines that have a deletion timestamp.
func HasOutdatedConfiguration ¶
HasOutdatedConfiguration returns a MachineFilter function to find all machines that do not match a given KubeadmControlPlane configuration hash.
func MatchesConfigurationHash ¶
MatchesConfigurationHash returns a MachineFilter function to find all machines that match a given KubeadmControlPlane configuration hash.
func OlderThan ¶
OlderThan returns a MachineFilter function to find all machines that have a CreationTimestamp earlier than the given time.
func OwnedControlPlaneMachines ¶
OwnedControlPlaneMachines returns a MachineFilter function to find all owned control plane machines. Usage: managementCluster.GetMachinesForCluster(ctx, cluster, OwnedControlPlaneMachines(controlPlane.Name))
func PickFewest ¶
func PickFewest(failureDomains clusterv1.FailureDomains, machines []*clusterv1.Machine) string
PickFewest returns the failure domain with the fewest number of machines.
Types ¶
type ManagementCluster ¶
type ManagementCluster struct {
Client ctrlclient.Client
}
ManagementCluster holds operations on the ManagementCluster
func (*ManagementCluster) GetEtcdCerts ¶
func (m *ManagementCluster) GetEtcdCerts(ctx context.Context, cluster types.NamespacedName) ([]byte, []byte, error)
GetEtcdCerts returns the EtcdCA Cert and Key for a given cluster.
func (*ManagementCluster) GetMachinesForCluster ¶
func (m *ManagementCluster) GetMachinesForCluster(ctx context.Context, cluster types.NamespacedName, filters ...func(machine *clusterv1.Machine) bool) ([]*clusterv1.Machine, error)
GetMachinesForCluster returns a list of machines that can be filtered or not. If no filter is supplied then all machines associated with the target cluster are returned.
func (*ManagementCluster) TargetClusterControlPlaneIsHealthy ¶
func (m *ManagementCluster) TargetClusterControlPlaneIsHealthy(ctx context.Context, clusterKey types.NamespacedName, controlPlaneName string) error
TargetClusterControlPlaneIsHealthy checks every node for control plane health.
func (*ManagementCluster) TargetClusterEtcdIsHealthy ¶
func (m *ManagementCluster) TargetClusterEtcdIsHealthy(ctx context.Context, clusterKey types.NamespacedName, controlPlaneName string) error
TargetClusterEtcdIsHealthy runs a series of checks over a target cluster's etcd cluster. In addition, it verifies that there are the same number of etcd members as control plane Machines.