Documentation
¶
Overview ¶
Package ingress derives a host's ingress routes from the store and pushes them to an operator-managed Caddy instance via the admin API. Nothing in this package talks to podman directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateDomains ¶
ValidateDomains checks that each domain is a syntactically valid lowercase FQDN and that the slice has no intra-slice duplicates. A nil/empty slice is valid (a non-web instance). Host-wide uniqueness across instances is enforced later, at route derivation.
Types ¶
type CaddyController ¶
type CaddyController struct {
// contains filtered or unexported fields
}
CaddyController is the production Controller. It drives routes on an operator-managed Caddy instance via the admin API.
func NewCaddyController ¶
func NewCaddyController(st Store, cfg Config) *CaddyController
NewCaddyController builds a controller. st serves both spec storage and template lookups, so ingress declarations are always read fresh from the store (no stale boot-time template snapshot). Caddy itself is managed by the operator; podman-api only manages its own route namespace via the admin API.
type Config ¶
type Config struct {
// AdminAddr is the Caddy admin API address (host:port) used when no
// per-host override is set. Default "localhost:2019".
AdminAddr string
// HostAdmins maps hostID to a per-host Caddy admin API address. Takes
// precedence over AdminAddr when set for the host being reconciled.
HostAdmins map[string]string
}
Config holds the operator-set knobs for the Caddy controller.
type Controller ¶
type Controller interface {
// Reconcile makes the host's Caddy proxy match the routes derived from the
// store: derives routes and pushes JSON routes via the Caddy admin API.
// Safe to call repeatedly; serialized per host.
Reconcile(ctx context.Context, host string) error
}
Controller reconciles a host's ingress (Caddy) state with the store.
type Disabled ¶
type Disabled struct{}
Disabled is the no-op Controller used when ingress is turned off. Reconcile does nothing so the rest of the system can call it unconditionally.