Documentation
¶
Overview ¶
Package gateway implements Gateway API controllers.
Predicates used by the GatewayClass reconciler's Builder. The reconciler is a single fat reconciler that re-translates all Gateway-API objects on every queue pull, so the predicate choice directly governs the controller's steady-state reconcile rate.
Background: the reconciler writes status conditions back to N Gateways and M Routes on every translation cycle. Every status write bumps the target's resourceVersion. With predicate.ResourceVersionChangedPredicate{} on every watch, each of those writes re-enqueues this controller, which translates again, which writes status again — a self-amplifying loop that drives the observed ~30 reconciles/sec/apiserver in steady state.
generationOrDeletion fires only on:
- spec changes (.metadata.generation bumps), which is what we actually need to retranslate, and
- the deletion-request Update (.metadata.deletionTimestamp set from zero), which is needed so finalizer cleanup paths run. Object types with finalizers do not go through Delete-event paths on the first delete — they go through Update with deletionTimestamp set, and only produce a Delete event after the controller clears its finalizer.
What this filters out (intentionally):
- The controller's own status writes (no generation change).
- Server-side managedFields churn on kubectl/Argo applies.
- Annotation/label edits that don't affect translation.
What this does NOT cover:
- corev1.Secret has no .spec/.status split; .metadata.generation is never bumped. Use predicate.ResourceVersionChangedPredicate{} for Secrets — the controller does not write Secrets, so there is no amplification loop to worry about.
- extensionsv1alpha2.EdgeFunction gates translation on Status.LiveRevision (see the field indexer in SetupWithManager). Status changes there MUST retrigger; use edgeFunctionRetrigger.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GatewayReconciler ¶
GatewayReconciler reconciles a Proxy object.
func NewGatewayReconciler ¶
func NewGatewayReconciler( c client.Client, pr *message.ProviderResources, opts ...Option, ) *GatewayReconciler
NewGatewayReconciler returns a new reconciler for Gateway API resources.
func (*GatewayReconciler) Reconcile ¶
func (r *GatewayReconciler) Reconcile(ctx context.Context, request reconcile.Request) (ctrl.Result, error)
Reconcile implements reconcile.Reconciler.
func (*GatewayReconciler) SetupWithManager ¶
SetupWithManager sets up the controller with the Controller Manager.
type Option ¶
type Option func(*GatewayReconciler)
func WithControllerNames ¶
WithControllerNames sets the controller names to watch for. If not set, defaults to both StandaloneControllerName and LegacyControllerName.