Documentation ¶
Index ¶
Constants ¶
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.
const (
// ControllerName is the name of this controller.
ControllerName = "managedseedset"
)
Variables ¶
var Now = metav1.Now
Now returns the current local time. Exposed for testing.
Functions ¶
func NewReconciler ¶
func NewReconciler(gardenClient client.Client, actuator Actuator, cfg *config.ManagedSeedSetControllerConfiguration) reconcile.Reconciler
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 client.Client, 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, mgr manager.Manager, config *config.ControllerManagerConfiguration, ) (*Controller, error)
NewManagedSeedSetController creates a new Gardener controller for ManagedSeedSets.
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 ¶
type ReplicaFactoryFunc func(*seedmanagementv1alpha1.ManagedSeedSet, *gardencorev1beta1.Shoot, *seedmanagementv1alpha1.ManagedSeed, *gardencorev1beta1.Seed, bool) Replica
ReplicaFactoryFunc is a function that implements ReplicaFactory.
func (ReplicaFactoryFunc) NewReplica ¶
func (f ReplicaFactoryFunc) 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 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 client.Client, apiReader client.Reader, 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.