machinedeployment

package
v1.5.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package machinedeployment implements the machinedeployment topology controller. NOTE: It is required to enable the ClusterTopology feature gate flag to activate managed topologies support.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reconciler

type Reconciler struct {
	Client client.Client
	// APIReader is used to list MachineSets directly via the API server to avoid
	// race conditions caused by an outdated cache.
	APIReader        client.Reader
	WatchFilterValue string
}

Reconciler deletes referenced templates during deletion of topology-owned MachineDeployments. The templates are only deleted, if they are not used in other MachineDeployments or MachineSets which are not in deleting state, i.e. the templates would otherwise be orphaned after the MachineDeployment deletion completes. Note: To achieve this the cluster topology controller sets a finalizer to hook into the MachineDeployment deletions.

func (*Reconciler) Reconcile

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

Reconcile deletes referenced templates during deletion of topology-owned MachineDeployments. The templates are only deleted, if they are not used in other MachineDeployments or MachineSets which are not in deleting state, i.e. the templates would otherwise be orphaned after the MachineDeployment deletion completes. Additional context: * MachineDeployment deletion:

  • MachineDeployments are deleted and garbage collected first (without waiting until all MachineSets are also deleted).
  • After that, deletion of MachineSets is automatically triggered by Kubernetes based on owner references.

Note: We assume templates are not reused by different MachineDeployments, which is only true for topology-owned

MachineDeployments.

We don't have to set the finalizer, as it's already set during MachineDeployment creation in the cluster topology controller.

func (*Reconciler) SetupWithManager

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

Jump to

Keyboard shortcuts

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