controller

package
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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

type ServiceReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ServiceReconciler reconciles a Service object

func (*ServiceReconciler) Reconcile

func (r *ServiceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL