controllers

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: AGPL-3.0 Imports: 36 Imported by: 0

Documentation

Overview

Package controllers implements Apoxy Control Plane-side controllers.

Index

Constants

View Source
const ApiServerFinalizer = "apiserver.apoxy.dev/finalizer"
View Source
const IndexServiceNetwork = "spec.networkRef.name"

IndexServiceNetwork is the cache index over spec.networkRef.name. Both watch mappings fan in through it, and every Tunnel event carries one — on a busy network that is one indexed lookup per connect/disconnect instead of a full scan of the project's VPCServices.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyReconciler

type ProxyReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

ProxyReconciler reconciles a Proxy object.

func NewProxyReconciler

func NewProxyReconciler(
	ctx context.Context,
	c client.Client,
	resources *message.ProviderResources,
	ipam net.IPAM,
	shutdown func(),
) *ProxyReconciler

NewProxyReconciler returns a new reconcile.Reconciler.

func (*ProxyReconciler) SetupWithManager

func (r *ProxyReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Controller Manager.

type RelayLeaseWatcher

type RelayLeaseWatcher struct {
	client.Client
	// contains filtered or unexported fields
}

RelayLeaseWatcher reconciles relay liveness from the coordination.apoxy.dev Lease each relay renews. It flips Relay.Status.Ready on liveness transitions only (crash -> not ready, recovery -> ready) and garbage-collects the Relay object and its stale lease once the lease has been expired past the grace period (§2.3) — a crashed relay never deletes its own lease, so expiry, not deletion, is the signal that reclaims it. Orphan-Tunnel GC keyed on the vanished relay lands in phase 5, when the connect path first creates Tunnels.

func NewRelayLeaseWatcher

func NewRelayLeaseWatcher(c client.Client, opts ...RelayLeaseWatcherOption) *RelayLeaseWatcher

NewRelayLeaseWatcher creates a RelayLeaseWatcher.

func (*RelayLeaseWatcher) Reconcile

Reconcile flips the owning Relay's readiness to match its lease liveness and garbage-collects the Relay (and stale lease) once expired past the grace.

func (*RelayLeaseWatcher) SetupWithManager

func (w *RelayLeaseWatcher) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager wires the watcher to relay Leases only.

type RelayLeaseWatcherOption

type RelayLeaseWatcherOption func(*RelayLeaseWatcher)

RelayLeaseWatcherOption configures a RelayLeaseWatcher.

func WithRelayGracePeriod

func WithRelayGracePeriod(d time.Duration) RelayLeaseWatcherOption

WithRelayGracePeriod overrides how long past expiry a relay is kept before GC.

func WithRelayLeaseCheckInterval

func WithRelayLeaseCheckInterval(d time.Duration) RelayLeaseWatcherOption

WithRelayLeaseCheckInterval overrides the re-check cadence for pending leases.

func WithRelayLeaseDuration

func WithRelayLeaseDuration(d time.Duration) RelayLeaseWatcherOption

WithRelayLeaseDuration overrides the staleness window.

func WithRelayLeaseNamespace

func WithRelayLeaseNamespace(ns string) RelayLeaseWatcherOption

WithRelayLeaseNamespace restricts the watcher to leases in the given namespace — the same namespace the registrar writes to. Relays are cluster-scoped, so without this a relay-prefixed lease deleted in any namespace would map onto (and delete) the like-named Relay.

type TunnelNodeReconciler

type TunnelNodeReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

TunnelNodeReconciler implements a basic garbage collector for dead/orphaned TunnelNode objects.

func NewTunnelNodeReconciler

func NewTunnelNodeReconciler(
	c client.Client,
	validator token.Validator,
	issuer token.TokenIssuer,
	jwksHost string,
	jwksPort int,
	tokenRefreshThreshold time.Duration,
	ipamv6, ipamv4 tunnet.IPAM,
) *TunnelNodeReconciler

func (*TunnelNodeReconciler) Reconcile

func (*TunnelNodeReconciler) ServeJWKS

func (r *TunnelNodeReconciler) ServeJWKS(ctx context.Context) error

ServeJWKS starts an HTTP server to serve JWK sets

func (*TunnelNodeReconciler) SetupWithManager

func (r *TunnelNodeReconciler) SetupWithManager(mgr ctrl.Manager) error

type VPCNetworkReconciler

type VPCNetworkReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

VPCNetworkReconciler is the standalone (OSS/single-tenant) provisioner for VPCNetworks: it assigns each network a 24-bit NetworkID and its overlay /72, mints the network's connect credential, and marks it Ready. In cloud this role is played by the infra-backed VPCNetworkProvisioner (APO-746); the API surface is identical so the relay wiring is the same in both modes. It is the sole writer of a network's identity and credential.

func NewVPCNetworkReconciler

func NewVPCNetworkReconciler(c client.Client) *VPCNetworkReconciler

NewVPCNetworkReconciler creates the OSS VPCNetwork provisioner. apiReader defaults to the cached client and is replaced with the manager's uncached reader in SetupWithManager so NetworkID assignment sees fresh writes.

func (*VPCNetworkReconciler) Reconcile

Reconcile assigns identity + credential to a VPCNetwork and marks it Ready.

func (*VPCNetworkReconciler) SetupWithManager

func (r *VPCNetworkReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager wires the provisioner to VPCNetwork objects.

type VPCServiceReconciler

type VPCServiceReconciler struct {
	client.Client
}

VPCServiceReconciler maintains a VPCService's endpoints view: the usable member Tunnels selected by the service's label selector, scoped to its network. It is the k8s Endpoints controller analog.

Tunnels are written by their owning relay at connect and deleted at disconnect; the only steady-state write is the status update that follows the create with the allocated overlay addresses. Every Tunnel watch event is therefore either a membership transition or that one address write, and both have to be acted on — a member is not an endpoint until it has an address (§2.4) — so no heartbeat-filtering predicate is needed.

func NewVPCServiceReconciler

func NewVPCServiceReconciler(c client.Client) *VPCServiceReconciler

NewVPCServiceReconciler creates a VPCService endpoints reconciler.

func (*VPCServiceReconciler) Reconcile

Reconcile recomputes a VPCService's endpoints from its selected Tunnels.

func (*VPCServiceReconciler) SetupWithManager

func (r *VPCServiceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager wires the reconciler to VPCServices, to the Tunnels that feed their membership, and to the VPCNetworks that scope them.

Jump to

Keyboard shortcuts

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