Documentation
¶
Index ¶
- Constants
- Variables
- func NewDropReplicaOptions() *dropReplicaOptions
- func NewDropReplicaOptionsArr(opts ...*dropReplicaOptions) (res dropReplicaOptionsArr)
- func NewInformerFactoryForCHOPGeneratedObjects(kubeClient kube.Interface, resyncPeriod time.Duration) kubeInformers.SharedInformerFactory
- func NewMigrateTableOptions() *migrateTableOptions
- func NewMigrateTableOptionsArr(opts ...*migrateTableOptions) (res migrateTableOptionsArr)
- func ShouldEnqueue(cr *api.ClickHouseInstallation) bool
- type Controller
- func (c *Controller) GetCR(obj meta.Object) (*api.ClickHouseInstallation, error)
- func (c *Controller) OnStatefulSetCreateFailed(ctx context.Context, host *api.Host) common.ErrorCRUD
- func (c *Controller) OnStatefulSetUpdateFailed(ctx context.Context, rollbackStatefulSet *apps.StatefulSet, host *api.Host, ...) common.ErrorCRUD
- func (c *Controller) Run(ctx context.Context)
- func (c *Controller) StartCHKWatcher(ctx context.Context)
- type Skip
- type VersionOptions
Constants ¶
const FinalizerName = "finalizer.clickhouseinstallation.altinity.com"
FinalizerName specifies name of the finalizer to be used with CHI
Variables ¶
var ( // ErrKeeperRefResolve indicates a failure to resolve a keeper reference (e.g., service not found). ErrKeeperRefResolve = errors.New("failed to resolve keeper ref") // ErrKeeperRefNoNodes indicates a keeper reference resolved successfully but produced zero nodes. ErrKeeperRefNoNodes = errors.New("keeper ref resolved to 0 nodes") // ErrKeeperNotReady indicates the referenced keeper's pods are not all Running yet. ErrKeeperNotReady = errors.New("keeper not ready") )
Functions ¶
func NewDropReplicaOptions ¶
func NewDropReplicaOptions() *dropReplicaOptions
func NewDropReplicaOptionsArr ¶
func NewDropReplicaOptionsArr(opts ...*dropReplicaOptions) (res dropReplicaOptionsArr)
NewDropReplicaOptionsArr creates new dropReplicaOptions array
func NewInformerFactoryForCHOPGeneratedObjects ¶
func NewInformerFactoryForCHOPGeneratedObjects( kubeClient kube.Interface, resyncPeriod time.Duration, ) kubeInformers.SharedInformerFactory
NewInformerFactoryForCHOPGeneratedObjects builds the kube informer factory, narrowed at the API server to objects the operator generated.
Without the selector these caches, and the DeltaFIFO feeding them, scale with the size of the whole cluster rather than with the number of managed installations: GetInformerNamespace falls back to NamespaceAll for every watch-namespace form except a single literal name, which covers the shipped kube-system bundle (where an empty include means watch-all) and OLM AllNamespaces (which arrives as ".*" and fails the DNS-label check).
Safe because these informers are an event source only - nothing takes a Lister or an Indexer off this factory, and reads go through the kube client directly - and because every handler already gates on the same label through isTrackedObject. The selector tests one of that gate's two conjuncts - the gate also requires the namespace to be watched - so everything it drops was already discarded by the handlers.
One behaviour does change: an object that LOSES the label leaves the selector, and the API server reports that to a filtered watch as a deletion carrying the last matching version. The handler therefore runs, and for a Pod that means one log line and one PodDelete counter - nothing destructive, and no further events for that object.
EndpointSlices are watched but written by kube, not by us; they match only because the EndpointSlice controller mirrors the Service's labels onto them.
func NewMigrateTableOptions ¶
func NewMigrateTableOptions() *migrateTableOptions
func NewMigrateTableOptionsArr ¶
func NewMigrateTableOptionsArr(opts ...*migrateTableOptions) (res migrateTableOptionsArr)
NewMigrateTableOptionsArr creates new migrateTableOptions array
func ShouldEnqueue ¶
func ShouldEnqueue(cr *api.ClickHouseInstallation) bool
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller defines CRO controller
func NewController ¶
func NewController( chopClient chopClientSet.Interface, extClient apiExtensions.Interface, kubeClient kube.Interface, dynamicClient dynamic.Interface, chopConfigInformerFactory chopInformers.SharedInformerFactory, chopInformerFactory chopInformers.SharedInformerFactory, kubeInformerFactory kubeInformers.SharedInformerFactory, ) *Controller
NewController creates instance of Controller
func (*Controller) GetCR ¶
func (c *Controller) GetCR(obj meta.Object) (*api.ClickHouseInstallation, error)
GetCR gets CR by any object that is either a CR itself or has labels referencing a CR
func (*Controller) OnStatefulSetCreateFailed ¶
func (c *Controller) OnStatefulSetCreateFailed(ctx context.Context, host *api.Host) common.ErrorCRUD
OnStatefulSetCreateFailed handles situation when StatefulSet create failed on k8s level
func (*Controller) OnStatefulSetUpdateFailed ¶
func (c *Controller) OnStatefulSetUpdateFailed(ctx context.Context, rollbackStatefulSet *apps.StatefulSet, host *api.Host, kubeSTS interfaces.IKubeSTS) common.ErrorCRUD
OnStatefulSetUpdateFailed handles situation when StatefulSet update failed in k8s level It can try to revert StatefulSet to its previous version, specified in rollbackStatefulSet
func (*Controller) Run ¶
func (c *Controller) Run(ctx context.Context)
Run syncs caches, starts workers
func (*Controller) StartCHKWatcher ¶
func (c *Controller) StartCHKWatcher(ctx context.Context)
StartCHKWatcher starts a dynamic informer for CHK resources. When a CHK transitions to Completed status, finds dependent CHIs and enqueues reconcile for them. Respects the reconcile.coordination.keeper.onKeeperResourceUpdate config setting.
type VersionOptions ¶
type VersionOptions struct {
Skip
}
Source Files
¶
- const.go
- controller-chk-watcher.go
- controller-config-map.go
- controller-deleter.go
- controller-discoverer.go
- controller-getter.go
- controller-keeper-resolver.go
- controller-pdb.go
- controller-secret.go
- controller-service.go
- controller-status.go
- controller.go
- version-options.go
- worker-app-version.go
- worker-boilerplate.go
- worker-config-map.go
- worker-deleter.go
- worker-hooks-events.go
- worker-hooks.go
- worker-keeper-resolver.go
- worker-migrator.go
- worker-monitoring.go
- worker-pdb.go
- worker-pod-retry.go
- worker-reconcile-gate.go
- worker-reconciler-chi.go
- worker-reconciler-chit.go
- worker-reconciler-helper.go
- worker-secret.go
- worker-service.go
- worker-statefulset-rollback.go
- worker-status-helpers.go
- worker-wait-exclude-include-restart.go
- worker-zk-integration.go
- worker.go