Documentation
¶
Overview ¶
Package operator reconciles CDCPipeline CRs into a coordinator StatefulSet: one coordinator per pipeline, owning the workers it creates. The operator stops reconciling once status.terminated is set — the job stays dead until a human clears it. Deletion always takes precedence over termination so a finished pipeline can be removed.
Package operator is the Kubernetes operator: it reconciles CDCPipeline CRs into the coordinator workload (its StatefulSet, Service, ConfigMap and RBAC) and validates spec mutations at admission.
Naming: the reconciler type is CoordinatorReconciler for the workload it manages — the coordinator — not for itself. The reconciler IS the operator.
Index ¶
Constants ¶
const DefaultFieldManager = "urutau-operator"
DefaultFieldManager is the Server-Side Apply field owner used when a CoordinatorReconciler does not set FieldManager. A deployment can override it (e.g. to run two controllers that manage the same objects).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CoordinatorReconciler ¶
type CoordinatorReconciler struct {
client.Client
Image string
Recorder record.EventRecorder
// FieldManager is the Server-Side Apply field owner for the objects this
// controller applies. Empty means DefaultFieldManager. Set it when another
// controller also manages these objects, so their field ownership does not
// collide.
FieldManager string
// KEDAPrometheusAddress is the Prometheus server the KEDA ScaledObjects
// query for the coordinator's per-table backlog gauge. Empty disables KEDA
// autoscaling entirely: no ScaledObject is rendered, and worker replicas
// stay at spec.workers.number (issue #298).
KEDAPrometheusAddress string
// KEDAThreshold is the per-replica backlog target (outstanding batches)
// handed to the ScaledObject trigger. Empty means defaultKEDAThreshold.
KEDAThreshold string
}
CoordinatorReconciler is the OPERATOR's reconciler for the CDCPipeline CR: the process that owns and applies the coordinator workload. The name describes WHAT it manages — the coordinator StatefulSet/Service/ConfigMap it creates, updates and deletes — not what it is. Every coordinator* helper (coordinatorName, coordinatorStatefulSet, …) follows the same convention: they name the object the operator provisions.
func (*CoordinatorReconciler) Reconcile ¶
func (r *CoordinatorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile reconciles a CDCPipeline: it ensures the coordinator workload reflects the spec, respects the terminal state, and cleans up on delete.
func (*CoordinatorReconciler) SetupWebhookWithManager ¶
func (r *CoordinatorReconciler) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager registers the validating webhook.
func (*CoordinatorReconciler) SetupWithManager ¶
func (r *CoordinatorReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager wires the reconciler into the manager.