Documentation
¶
Index ¶
Constants ¶
const ( AnnotationExpose = "gateway.homelab.local/expose" AnnotationHostname = "gateway.homelab.local/hostname" AnnotationGateway = "gateway.homelab.local/gateway" AnnotationGatewayNamespace = "gateway.homelab.local/gateway-namespace" AnnotationPort = "gateway.homelab.local/port" FinalizerHTTPRoute = "gateway.homelab.local/httproute-finalizer" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServiceReconciler ¶
ServiceReconciler reconciles a Service object
func (*ServiceReconciler) Reconcile ¶
Reconcile implements the reconciliation loop for Service resources. It watches Services with the expose annotation and creates/updates/deletes corresponding HTTPRoute and ReferenceGrant resources.
The reconciler follows modern Kubernetes controller best practices: - Level-based triggers (reconciles full state, not just events) - Idempotent operations (safe to call multiple times) - Finalizers for cross-namespace resource cleanup (HTTPRoute) - OwnerReferences for same-namespace resources (ReferenceGrant) - Cross-namespace resource management via ReferenceGrant
func (*ServiceReconciler) SetupWithManager ¶
func (r *ServiceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager. Watches Services and owns ReferenceGrant resources. HTTPRoute is NOT owned via OwnerReferences (cross-namespace not supported). Instead, finalizers on Service ensure cleanup of HTTPRoute on deletion. Uses modern controller-runtime patterns: - For() watches the primary resource (Service) - Owns() watches secondary resources for changes (triggers reconciliation of owner)