Documentation ¶
Overview ¶
Package controllers is used to provide the core functionalities of hvpa-controller
Index ¶
- Constants
- Variables
- func RecheckDeletionTimestamp(getObject func() (metav1.Object, error)) func() error
- type BaseControllerRefManager
- type CompactionLeaseController
- func (lc *CompactionLeaseController) InitializeControllerWithImageVector() (*CompactionLeaseController, error)
- func (lc *CompactionLeaseController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (lc *CompactionLeaseController) SetupWithManager(mgr ctrl.Manager, workers int) error
- type EtcdCopyBackupsTaskReconciler
- func (r *EtcdCopyBackupsTaskReconciler) InitializeControllerWithChartApplier() (*EtcdCopyBackupsTaskReconciler, error)
- func (r *EtcdCopyBackupsTaskReconciler) InitializeControllerWithImageVector() (*EtcdCopyBackupsTaskReconciler, error)
- func (r *EtcdCopyBackupsTaskReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *EtcdCopyBackupsTaskReconciler) SetupWithManager(mgr ctrl.Manager, workers int) error
- type EtcdCustodian
- type EtcdDruidRefManager
- func (m *EtcdDruidRefManager) AdoptResource(ctx context.Context, obj client.Object) error
- func (m *EtcdDruidRefManager) FetchStatefulSet(ctx context.Context, etcd *druidv1alpha1.Etcd) (*appsv1.StatefulSetList, error)
- func (m *EtcdDruidRefManager) ReleaseResource(ctx context.Context, obj client.Object) error
- type EtcdReconciler
- func NewEtcdReconciler(mgr manager.Manager, disableEtcdServiceAccountAutomount bool) (*EtcdReconciler, error)
- func NewEtcdReconcilerWithImageVector(mgr manager.Manager, disableEtcdServiceAccountAutomount bool) (*EtcdReconciler, error)
- func NewReconcilerWithImageVector(mgr manager.Manager, disableEtcdServiceAccountAutomount bool) (*EtcdReconciler, error)
- func (r *EtcdReconciler) InitializeControllerWithChartApplier() (*EtcdReconciler, error)
- func (r *EtcdReconciler) InitializeControllerWithImageVector() (*EtcdReconciler, error)
- func (r *EtcdReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *EtcdReconciler) SetupWithManager(mgr ctrl.Manager, workers int, ignoreOperationAnnotation bool) error
- type Secret
Constants ¶
const ( // FinalizerName is the name of the Plant finalizer. FinalizerName = "druid.gardener.cloud/etcd-druid" // DefaultImageVector is a constant for the path to the default image vector file. DefaultImageVector = "images.yaml" // DefaultInterval is the default interval for retry operations. DefaultInterval = 5 * time.Second // EtcdReady implies that etcd is ready EtcdReady = true // DefaultAutoCompactionRetention defines the default auto-compaction-retention length for etcd. DefaultAutoCompactionRetention = "30m" // Annotation set by human operator in order to stop reconciliation IgnoreReconciliationAnnotation = "druid.gardener.cloud/ignore-reconciliation" )
const ( // DefaultETCDQuota is the default etcd quota. DefaultETCDQuota = 8 * 1024 * 1024 * 1024 // 8Gi )
Variables ¶
var ( // DefaultTimeout is the default timeout for retry operations. DefaultTimeout = 1 * time.Minute )
var ( // UncachedObjectList is a list of objects which should not be cached. UncachedObjectList = []client.Object{ &corev1.Event{}, &eventsv1beta1.Event{}, &eventsv1.Event{}, } )
Functions ¶
func RecheckDeletionTimestamp ¶
RecheckDeletionTimestamp returns a CanAdopt() function to recheck deletion.
The CanAdopt() function calls getObject() to fetch the latest value, and denies adoption attempts if that object has a non-nil DeletionTimestamp.
Types ¶
type BaseControllerRefManager ¶
type BaseControllerRefManager struct { Controller metav1.Object Selector labels.Selector CanAdoptFunc func() error // contains filtered or unexported fields }
BaseControllerRefManager is the struct is used to identify the base controller of the object
func (*BaseControllerRefManager) CanAdopt ¶
func (m *BaseControllerRefManager) CanAdopt() error
CanAdopt is used to identify if the object can be adopted by the controller
type CompactionLeaseController ¶ added in v0.7.0
type CompactionLeaseController struct { client.Client ImageVector imagevector.ImageVector // contains filtered or unexported fields }
CompactionLeaseController reconciles compaction job
func NewCompactionLeaseController ¶ added in v0.7.0
func NewCompactionLeaseController(mgr manager.Manager, config controllersconfig.CompactionLeaseConfig) *CompactionLeaseController
NewCompactionLeaseController creates a new CompactionLeaseController object
func NewCompactionLeaseControllerWithImageVector ¶ added in v0.7.0
func NewCompactionLeaseControllerWithImageVector(mgr manager.Manager, config controllersconfig.CompactionLeaseConfig) (*CompactionLeaseController, error)
NewCompactionLeaseControllerWithImageVector creates a new CompactionLeaseController object
func (*CompactionLeaseController) InitializeControllerWithImageVector ¶ added in v0.7.0
func (lc *CompactionLeaseController) InitializeControllerWithImageVector() (*CompactionLeaseController, error)
InitializeControllerWithImageVector will use CompactionLeaseController client to initialize image vector for etcd and backup restore images.
func (*CompactionLeaseController) Reconcile ¶ added in v0.7.0
func (lc *CompactionLeaseController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile reconciles the compaction job.
func (*CompactionLeaseController) SetupWithManager ¶ added in v0.7.0
func (lc *CompactionLeaseController) SetupWithManager(mgr ctrl.Manager, workers int) error
SetupWithManager sets up manager with a new controller and ec as the reconcile.Reconciler
type EtcdCopyBackupsTaskReconciler ¶ added in v0.7.0
type EtcdCopyBackupsTaskReconciler struct { client.Client // contains filtered or unexported fields }
EtcdCopyBackupsTaskReconciler reconciles EtcdCopyBackupsTask object.
func NewEtcdCopyBackupsTaskReconciler ¶ added in v0.7.0
func NewEtcdCopyBackupsTaskReconciler(mgr manager.Manager) (*EtcdCopyBackupsTaskReconciler, error)
NewEtcdCopyBackupsTaskReconciler creates a new EtcdCopyBackupsTaskReconciler.
func NewEtcdCopyBackupsTaskReconcilerWithImageVector ¶ added in v0.7.0
func NewEtcdCopyBackupsTaskReconcilerWithImageVector(mgr manager.Manager) (*EtcdCopyBackupsTaskReconciler, error)
NewEtcdCopyBackupsTaskReconcilerWithImageVector creates a new EtcdCopyBackupsTaskReconciler and initializes its image vector.
func (*EtcdCopyBackupsTaskReconciler) InitializeControllerWithChartApplier ¶ added in v0.7.0
func (r *EtcdCopyBackupsTaskReconciler) InitializeControllerWithChartApplier() (*EtcdCopyBackupsTaskReconciler, error)
InitializeControllerWithChartApplier will use EtcdCopyBackupsTaskReconciler rest config to initialize a chart applier.
func (*EtcdCopyBackupsTaskReconciler) InitializeControllerWithImageVector ¶ added in v0.7.0
func (r *EtcdCopyBackupsTaskReconciler) InitializeControllerWithImageVector() (*EtcdCopyBackupsTaskReconciler, error)
InitializeControllerWithImageVector will use EtcdCopyBackupsTaskReconciler client to initialize an image vector.
func (*EtcdCopyBackupsTaskReconciler) Reconcile ¶ added in v0.7.0
func (r *EtcdCopyBackupsTaskReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile reconciles the EtcdCopyBackupsTask.
func (*EtcdCopyBackupsTaskReconciler) SetupWithManager ¶ added in v0.7.0
func (r *EtcdCopyBackupsTaskReconciler) SetupWithManager(mgr ctrl.Manager, workers int) error
SetupWithManager sets up with the given manager a new controller with r as the ctrl.Reconciler.
type EtcdCustodian ¶ added in v0.5.0
type EtcdCustodian struct { client.Client Scheme *runtime.Scheme // contains filtered or unexported fields }
EtcdCustodian reconciles status of Etcd object
func NewEtcdCustodian ¶ added in v0.5.0
func NewEtcdCustodian(mgr manager.Manager, config controllersconfig.EtcdCustodianController) *EtcdCustodian
NewEtcdCustodian creates a new EtcdCustodian object
func (*EtcdCustodian) SetupWithManager ¶ added in v0.5.0
func (ec *EtcdCustodian) SetupWithManager(ctx context.Context, mgr ctrl.Manager, workers int, ignoreOperationAnnotation bool) error
SetupWithManager sets up manager with a new controller and ec as the reconcile.Reconciler
type EtcdDruidRefManager ¶
type EtcdDruidRefManager struct { BaseControllerRefManager // contains filtered or unexported fields }
EtcdDruidRefManager is the struct used to manage its child objects
func NewEtcdDruidRefManager ¶
func NewEtcdDruidRefManager( cl client.Client, scheme *runtime.Scheme, controller metav1.Object, selector labels.Selector, controllerKind schema.GroupVersionKind, canAdopt func() error, ) *EtcdDruidRefManager
NewEtcdDruidRefManager returns a EtcdDruidRefManager that exposes methods to manage the controllerRef of its child objects.
The CanAdopt() function can be used to perform a potentially expensive check (such as a live GET from the API server) prior to the first adoption. It will only be called (at most once) if an adoption is actually attempted. If CanAdopt() returns a non-nil error, all adoptions will fail.
func (*EtcdDruidRefManager) AdoptResource ¶ added in v0.2.0
AdoptResource sends a patch to take control of the Etcd. It returns the error if the patching fails.
func (*EtcdDruidRefManager) FetchStatefulSet ¶ added in v0.5.0
func (m *EtcdDruidRefManager) FetchStatefulSet(ctx context.Context, etcd *druidv1alpha1.Etcd) (*appsv1.StatefulSetList, error)
FetchStatefulSet fetches statefulset based on ETCD resource
func (*EtcdDruidRefManager) ReleaseResource ¶ added in v0.2.0
ReleaseResource sends a patch to free the resource from the control of the controller. It returns the error if the patching fails. 404 and 422 errors are ignored.
type EtcdReconciler ¶
type EtcdReconciler struct { client.Client Scheme *runtime.Scheme Config *rest.Config ImageVector imagevector.ImageVector // contains filtered or unexported fields }
EtcdReconciler reconciles a Etcd object
func NewEtcdReconciler ¶
func NewEtcdReconciler(mgr manager.Manager, disableEtcdServiceAccountAutomount bool) (*EtcdReconciler, error)
NewEtcdReconciler creates a new EtcdReconciler object
func NewEtcdReconcilerWithImageVector ¶ added in v0.1.4
func NewEtcdReconcilerWithImageVector(mgr manager.Manager, disableEtcdServiceAccountAutomount bool) (*EtcdReconciler, error)
NewEtcdReconcilerWithImageVector creates a new EtcdReconciler object
func NewReconcilerWithImageVector ¶ added in v0.1.4
func NewReconcilerWithImageVector(mgr manager.Manager, disableEtcdServiceAccountAutomount bool) (*EtcdReconciler, error)
NewReconcilerWithImageVector creates a new EtcdReconciler object with an image vector
func (*EtcdReconciler) InitializeControllerWithChartApplier ¶
func (r *EtcdReconciler) InitializeControllerWithChartApplier() (*EtcdReconciler, error)
InitializeControllerWithChartApplier will use EtcdReconciler client to initialize a Kubernetes client as well as a Chart renderer.
func (*EtcdReconciler) InitializeControllerWithImageVector ¶ added in v0.1.4
func (r *EtcdReconciler) InitializeControllerWithImageVector() (*EtcdReconciler, error)
InitializeControllerWithImageVector will use EtcdReconciler client to initialize image vector for etcd and backup restore images.
func (*EtcdReconciler) SetupWithManager ¶
func (r *EtcdReconciler) SetupWithManager(mgr ctrl.Manager, workers int, ignoreOperationAnnotation bool) error
SetupWithManager sets up manager with a new controller and r as the reconcile.Reconciler