managedseed

package
v1.97.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ControllerName is the name of this controller.
	ControllerName = "managedseed"

	// GardenletDefaultKubeconfigSecretName is the default name for the field in the Gardenlet component configuration
	// .gardenClientConnection.KubeconfigSecret.Name
	GardenletDefaultKubeconfigSecretName = "gardenlet-kubeconfig"
	// GardenletDefaultKubeconfigBootstrapSecretName is the default name for the field in the Gardenlet component configuration
	// .gardenClientConnection.BootstrapKubeconfig.Name
	GardenletDefaultKubeconfigBootstrapSecretName = "gardenlet-kubeconfig-bootstrap"
)

Variables

View Source
var RandomDurationWithMetaDuration = utils.RandomDurationWithMetaDuration

RandomDurationWithMetaDuration is an alias for `utils.RandomDurationWithMetaDuration`. Exposed for unit tests.

Functions

func GetSeed added in v1.97.0

func GetSeed(ctx context.Context, gardenClient client.Client, seedName string) (*gardencorev1beta1.Seed, error)

GetSeed returns the seed with the given name if found. If not, nil is returned.

func PrepareGardenletChartValues added in v1.97.0

func PrepareGardenletChartValues(
	ctx context.Context,
	log logr.Logger,
	gardenClient client.Client,
	gardenRESTConfig *rest.Config,
	targetClusterClient client.Client,
	recorder record.EventRecorder,
	obj client.Object,
	seed *gardencorev1beta1.Seed,
	vp ValuesHelper,
	bootstrap seedmanagementv1alpha1.Bootstrap,
	gardenletDeployment *seedmanagementv1alpha1.GardenletDeployment,
	gardenletConfig *gardenletv1alpha1.GardenletConfiguration,
	gardenNamespaceTargetCluster string,
) (
	map[string]any,
	error,
)

PrepareGardenletChartValues prepares the gardenlet chart values based on the config.

Types

type Actuator

type Actuator interface {
	// Reconcile reconciles ManagedSeed creation or update.
	Reconcile(context.Context, logr.Logger, *seedmanagementv1alpha1.ManagedSeed) (*seedmanagementv1alpha1.ManagedSeedStatus, bool, error)
	// Delete reconciles ManagedSeed deletion.
	Delete(context.Context, logr.Logger, *seedmanagementv1alpha1.ManagedSeed) (*seedmanagementv1alpha1.ManagedSeedStatus, bool, bool, error)
}

Actuator acts upon ManagedSeed resources.

type Reconciler added in v1.63.0

type Reconciler struct {
	GardenClient          client.Client
	Actuator              Actuator
	Config                config.GardenletConfiguration
	Clock                 clock.Clock
	ShootClientMap        clientmap.ClientMap
	GardenNamespaceGarden string
	GardenNamespaceShoot  string
}

Reconciler reconciles the ManagedSeed.

func (*Reconciler) AddToManager added in v1.63.0

func (r *Reconciler) AddToManager(
	ctx context.Context,
	mgr manager.Manager,
	gardenCluster cluster.Cluster,
	seedCluster cluster.Cluster,
) error

AddToManager adds Reconciler to the given manager.

func (*Reconciler) EnqueueWithJitterDelay added in v1.63.0

func (r *Reconciler) EnqueueWithJitterDelay() handler.EventHandler

EnqueueWithJitterDelay returns handler.Funcs which enqueues the object with a random Jitter duration when the JitterUpdate is enabled in ManagedSeed controller configuration. All other events are normally enqueued.

func (*Reconciler) ManagedSeedPredicate added in v1.63.0

func (r *Reconciler) ManagedSeedPredicate(ctx context.Context, seedName string) predicate.Predicate

ManagedSeedPredicate returns the predicate for ManagedSeed events.

func (*Reconciler) MapSeedToManagedSeed added in v1.63.0

func (r *Reconciler) MapSeedToManagedSeed(_ context.Context, _ logr.Logger, _ client.Reader, obj client.Object) []reconcile.Request

MapSeedToManagedSeed is a mapper.MapFunc for mapping a Seed to the owning ManagedSeed.

func (*Reconciler) Reconcile added in v1.63.0

func (r *Reconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error)

Reconcile performs the main reconciliation logic.

func (*Reconciler) SeedOfManagedSeedPredicate added in v1.63.0

func (r *Reconciler) SeedOfManagedSeedPredicate(ctx context.Context, seedName string) predicate.Predicate

SeedOfManagedSeedPredicate returns the predicate for Seed events.

type ValuesHelper

type ValuesHelper interface {
	// MergeGardenletDeployment merges the given GardenletDeployment with the values from the parent gardenlet.
	MergeGardenletDeployment(*seedmanagementv1alpha1.GardenletDeployment, *gardencorev1beta1.Shoot) (*seedmanagementv1alpha1.GardenletDeployment, error)
	// MergeGardenletConfiguration merges the given GardenletConfiguration with the parent GardenletConfiguration.
	MergeGardenletConfiguration(config *gardenletv1alpha1.GardenletConfiguration) (*gardenletv1alpha1.GardenletConfiguration, error)
	// GetGardenletChartValues computes the values to be used when applying the gardenlet chart.
	GetGardenletChartValues(*seedmanagementv1alpha1.GardenletDeployment, *gardenletv1alpha1.GardenletConfiguration, string) (map[string]any, error)
}

ValuesHelper provides methods for merging GardenletDeployment and GardenletConfiguration with parent, as well as computing the values to be used when applying the gardenlet chart.

func NewValuesHelper added in v1.20.0

func NewValuesHelper(config *config.GardenletConfiguration) ValuesHelper

NewValuesHelper creates a new ValuesHelper with the given parent GardenletConfiguration and image vector.

Directories

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

Jump to

Keyboard shortcuts

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