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 ¶
This section is empty.
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
// 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.