managedseedset

package
v1.42.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventCreatingShoot                   = "CreatingShoot"
	EventDeletingShoot                   = "DeletingShoot"
	EventRetryingShootReconciliation     = "RetryingShootReconciliation"
	EventNotRetryingShootReconciliation  = "NotRetryingShootReconciliation"
	EventRetryingShootDeletion           = "RetryingShootDeletion"
	EventNotRetryingShootDeletion        = "NotRetryingShootDeletion"
	EventWaitingForShootReconciled       = "WaitingForShootReconciled"
	EventWaitingForShootDeleted          = "WaitingForShootDeleted"
	EventWaitingForShootHealthy          = "WaitingForShootHealthy"
	EventCreatingManagedSeed             = "CreatingManagedSeed"
	EventDeletingManagedSeed             = "DeletingManagedSeed"
	EventWaitingForManagedSeedRegistered = "WaitingForManagedSeedRegistered"
	EventWaitingForManagedSeedDeleted    = "WaitingForManagedSeedDeleted"
	EventWaitingForSeedReady             = "WaitingForSeedReady"
)

Event reason constants.

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

Variables

View Source
var Now = metav1.Now

Now returns the current local time. Exposed for testing.

Functions

func NewReconciler

NewReconciler creates and returns a new ManagedSeedSet reconciler with the given parameters.

Types

type Actuator

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

Actuator acts upon ManagedSeedSet resources.

func NewActuator

func NewActuator(
	gardenClient kubernetes.Interface,
	replicaGetter ReplicaGetter,
	replicaFactory ReplicaFactory,
	cfg *config.ManagedSeedSetControllerConfiguration,
	recorder record.EventRecorder,
) Actuator

NewActuator creates and returns a new Actuator with the given parameters.

type Controller

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

Controller controls ManagedSeedSets.

func NewManagedSeedSetController

func NewManagedSeedSetController(
	ctx context.Context,
	log logr.Logger,
	clientMap clientmap.ClientMap,
	config *config.ControllerManagerConfiguration,
	recorder record.EventRecorder,
) (*Controller, error)

NewManagedSeedSetController creates a new Gardener controller for ManagedSeedSets.

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, workers int)

Run runs the Controller until the given context is cancelled.

type Replica

type Replica interface {
	// GetName returns this replica's name.
	GetName() string
	// GetFullName returns this replica's full name.
	GetFullName() string
	// GetObjectKey returns this replica's ObjectKey.
	GetObjectKey() client.ObjectKey
	// GetOrdinal returns this replica's ordinal. If the replica has no ordinal, -1 is returned.
	GetOrdinal() int
	// GetStatus returns this replica's status. If the replica's managed seed doesn't exist,
	// it returns one of the StatusShoot* statuses, depending on the shoot state.
	// Otherwise, it returns one of the ManagedSeed* statuses, depending on the managed seed state.
	GetStatus() ReplicaStatus
	// IsSeedReady returns true if this replica's seed is ready, false otherwise.
	IsSeedReady() bool
	// GetShootHealthStatus returns this replica's shoot health status (healthy, progressing, or unhealthy).
	GetShootHealthStatus() operationshoot.Status
	// IsDeletable returns true if this replica can be deleted, false otherwise. A replica can be deleted if it has no
	// scheduled shoots and is not protected by the "protect-from-deletion" annotation.
	IsDeletable() bool
	// CreateShoot initializes this replica's shoot and then creates it using the given context and client.
	CreateShoot(ctx context.Context, c client.Client, ordinal int) error
	// CreateManagedSeed initializes this replica's managed seed, and then creates it using the given context and client.
	CreateManagedSeed(ctx context.Context, c client.Client) error
	// DeleteShoot deletes this replica's shoot using the given context and client.
	DeleteShoot(ctx context.Context, c client.Client) error
	// DeleteManagedSeed deletes this replica's managed seed using the given context and client.
	DeleteManagedSeed(ctx context.Context, c client.Client) error
	// RetryShoot retries this replica's shoot using the given context and client.
	RetryShoot(ctx context.Context, c client.Client) error
}

Replica represents a ManagedSeedSet replica.

func NewReplica

func NewReplica(
	set *seedmanagementv1alpha1.ManagedSeedSet,
	shoot *gardencorev1beta1.Shoot,
	managedSeed *seedmanagementv1alpha1.ManagedSeed,
	seed *gardencorev1beta1.Seed,
	hasScheduledShoots bool,
) Replica

NewReplica creates and returns a new Replica with the given parameters.

type ReplicaFactory

type ReplicaFactory interface {
	// NewReplica creates and returns a new replica with the given parameters.
	NewReplica(*seedmanagementv1alpha1.ManagedSeedSet, *gardencorev1beta1.Shoot, *seedmanagementv1alpha1.ManagedSeed, *gardencorev1beta1.Seed, bool) Replica
}

ReplicaFactory provides a method for creating new replicas.

type ReplicaFactoryFunc

ReplicaFactoryFunc is a function that implements ReplicaFactory.

func (ReplicaFactoryFunc) NewReplica

NewReplica creates and returns a new Replica with the given parameters.

type ReplicaGetter

type ReplicaGetter interface {
	// GetReplicas gets and returns all existing replicas of the given set.
	GetReplicas(context.Context, *seedmanagementv1alpha1.ManagedSeedSet) ([]Replica, error)
}

ReplicaGetter provides a method for getting all existing replicas of a ManagedSeedSet.

func NewReplicaGetter

func NewReplicaGetter(client kubernetes.Interface, replicaFactory ReplicaFactory) ReplicaGetter

NewReplicaGetter creates and returns a new ReplicaGetter with the given parameters.

type ReplicaStatus

type ReplicaStatus int

ReplicaStatus represents a creation / update / deletion status of a ManagedSeedSet replica. During replica creation / update, the status changes like this: x => ShootReconciling => ShootReconciled => ManagedSeedPreparing => ManagedSeedRegistered During replica deletion, the status changes like this: ManagedSeedRegistered => ManagedSeedDeleting => ShootReconciled => ShootDeleting => x If shoot reconciliation or deletion fails, the status can become also ShootReconcileFailed or ShootDeleteFailed. Upon retry, it will become ShootReconciling or ShootDeleting until it either succeeds or fails again. Note that we are only interested in the shoot reconciliation / deletion status if the managed seed doesn't exist (either not created yet or already deleted), or if it's on a lower revision than the shoot (during updates).

const (
	StatusUnknown               ReplicaStatus = iota // 0
	StatusShootReconcileFailed                       // 1
	StatusShootDeleteFailed                          // 2
	StatusShootReconciling                           // 3
	StatusShootDeleting                              // 4
	StatusShootReconciled                            // 5
	StatusManagedSeedPreparing                       // 6
	StatusManagedSeedDeleting                        // 7
	StatusManagedSeedRegistered                      // 8
)

Replica status constants

func (ReplicaStatus) String

func (rs ReplicaStatus) String() string

String returns a representation of this replica status as a string.

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