Documentation
¶
Overview ¶
Package ingressctl reconciles the ingress route table from the service store and resolves upstream targets from the dataplane endpoint cache.
This is the consumer side of the RUNE-066 wiring whose producer half lives in pkg/orchestrator/controllers/instance_controller.go (PublishService -> OrderedLog -> dataplane.Cache). Without this controller, the ingress Subsystem's Router stays empty and every inbound request to an `expose.host` returns 404.
Index ¶
Constants ¶
const ManualLogRepeat = 5 * time.Minute
ManualLogRepeat is how often we re-emit "still failing" warnings for a misconfigured manual-TLS Secret. First failure logs immediately; subsequent failures of the same (host, errKind) are suppressed until this interval elapses. A successful push clears the dedup entry so the next failure logs immediately again.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Router is the ingress route table to keep in sync. Required.
Router *ingress.Router
// Store is the agent's local state store. Required.
Store store.Store
// Cache is the dataplane endpoint cache used by Resolve to
// answer ingress.UpstreamResolver lookups. Required.
Cache *dataplane.Cache
// ACME is the optional certificate orchestrator. When non-nil,
// the controller submits a Request for every service whose
// Expose.TLS asks for ACME on each reconcile.
ACME *acme.Orchestrator
// Secrets, when set, lets the controller resolve `tls.mode:
// manual` exposes by reading the named Secret and pushing its
// `tls.crt` / `tls.key` data into Certs on each reconcile (so
// secret rotation flows through without operator action).
Secrets *repos.SecretRepo
// Certs is the same CertStore the ACME orchestrator + ingress
// cert loader are wired against. Required to enable manual
// mode; nil disables manual-mode handling.
Certs acme.CertStore
// Logger is the structured logger. Defaults to "ingressctl".
Logger log.Logger
// ReconcilePeriod is how often the controller rebuilds the
// route table from the store as a safety net. Defaults to 2s.
ReconcilePeriod time.Duration
}
Config bundles the controller's required dependencies.
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller reconciles ingress routes from the service store and implements ingress.UpstreamResolver against the dataplane cache.
func New ¶
func New(cfg Config) *Controller
New constructs a Controller. Logger and ReconcilePeriod default.
func (*Controller) Resolve ¶
func (c *Controller) Resolve(namespace, service string, port int) (string, bool)
Resolve implements ingress.UpstreamResolver. It returns the first healthy endpoint for the named service from the dataplane cache, dialable as "ip:port". The dataplane Cache is keyed by service name today (see internal/agent/dns/wire.go EndpointPublisher), so namespace is accepted for interface compatibility but unused. The port argument is used as a fallback when the cached endpoint has no recorded port.
func (*Controller) Run ¶
func (c *Controller) Run(ctx context.Context)
Run blocks until ctx is done, periodically rebuilding the route table from the service store. Safe to call once per Controller.