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 ¶
InitFromFlags initializes the config from the provided CLI flag set.
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 ¶
NewReconciler creates a new reconciler for Etcd.
func NewReconcilerWithImageVector ¶
func NewReconcilerWithImageVector(mgr manager.Manager, controllerName string, 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 ¶
Reconcile manages the reconciliation of the Etcd component to align it with its desired specifications.
The reconciliation process involves the following steps:
- Deletion Handling: If the Etcd component has a deletionTimestamp, initiate the deletion workflow. On error, requeue the request.
- Spec Reconciliation : Determine whether the Etcd spec should be reconciled based on annotations and flags and if there is a need then reconcile spec.
- Status Reconciliation: Always update the status of the Etcd component to reflect its current state.
- Scheduled Requeue: Requeue the reconciliation request after a defined period (EtcdStatusSyncPeriod) to maintain sync.
func (*Reconciler) RegisterWithManager ¶
func (r *Reconciler) RegisterWithManager(mgr ctrl.Manager, controllerName string) error
RegisterWithManager registers the Etcd Controller with the given controller manager.