etcd

package
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Workers is the number of workers concurrently processing reconciliation requests.
	Workers int
	// IgnoreOperationAnnotation specifies whether to ignore or honour the operation annotation on resources to be reconciled.
	// Deprecated: Use EnableEtcdSpecAutoReconcile instead.
	IgnoreOperationAnnotation bool
	// EnableEtcdSpecAutoReconcile controls how the Etcd Spec is reconciled. If set to true, then any change in Etcd spec
	// will automatically trigger a reconciliation of the Etcd resource. If set to false, then an operator needs to
	// explicitly set gardener.cloud/operation=reconcile annotation on the Etcd resource to trigger reconciliation
	// of the Etcd spec.
	// NOTE: Decision to enable it should be carefully taken as spec updates could potentially result in rolling update
	// of the StatefulSet which will cause a minor downtime for a single node etcd cluster and can potentially cause a
	// downtime for a multi-node etcd cluster.
	EnableEtcdSpecAutoReconcile bool
	// DisableEtcdServiceAccountAutomount controls the auto-mounting of service account token for ETCD StatefulSets.
	DisableEtcdServiceAccountAutomount bool
	// EtcdStatusSyncPeriod is the duration after which an event will be re-queued ensuring ETCD status synchronization.
	EtcdStatusSyncPeriod time.Duration
	// FeatureGates contains the feature gates to be used by Etcd Controller.
	FeatureGates map[featuregate.Feature]bool

	// EtcdMember holds configuration related to etcd members.
	EtcdMember MemberConfig
}

Config defines the configuration for the Etcd Controller.

func (*Config) CaptureFeatureActivations

func (cfg *Config) CaptureFeatureActivations(fg featuregate.FeatureGate)

CaptureFeatureActivations captures all feature gates required by the controller into controller config

func (*Config) InitFromFlags

func (cfg *Config) InitFromFlags(fs *flag.FlagSet)

InitFromFlags initializes the config from the provided CLI flag set.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the config.

type MemberConfig

type MemberConfig struct {
	// NotReadyThreshold is the duration after which an etcd member's state is considered `NotReady`.
	NotReadyThreshold time.Duration
	// UnknownThreshold is the duration after which an etcd member's state is considered `Unknown`.
	UnknownThreshold time.Duration
}

MemberConfig holds configuration related to etcd members.

type Reconciler

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

Reconciler reconciles the Etcd resource spec and status.

func NewReconciler

func NewReconciler(mgr manager.Manager, config *Config) (*Reconciler, error)

NewReconciler creates a new reconciler for Etcd.

func NewReconcilerWithImageVector

func NewReconcilerWithImageVector(mgr manager.Manager, config *Config, iv imagevector.ImageVector) (*Reconciler, error)

NewReconcilerWithImageVector creates a new reconciler for Etcd with the given image vector.

func (*Reconciler) GetOperatorRegistry

func (r *Reconciler) GetOperatorRegistry() component.Registry

GetOperatorRegistry returns the component registry.

func (*Reconciler) Reconcile

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

Reconcile manages the reconciliation of the Etcd component to align it with its desired specifications.

The reconciliation process involves the following steps:

  1. Deletion Handling: If the Etcd component has a deletionTimestamp, initiate the deletion workflow. On error, requeue the request.
  2. Spec Reconciliation : Determine whether the Etcd spec should be reconciled based on annotations and flags and if there is a need then reconcile spec.
  3. Status Reconciliation: Always update the status of the Etcd component to reflect its current state.
  4. Scheduled Requeue: Requeue the reconciliation request after a defined period (EtcdStatusSyncPeriod) to maintain sync.

func (*Reconciler) RegisterWithManager

func (r *Reconciler) RegisterWithManager(mgr ctrl.Manager) error

RegisterWithManager registers the Etcd Controller with the given controller manager.

Jump to

Keyboard shortcuts

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