mirror of
https://github.com/Dvorinka/Containr.git
synced 2026-10-28 15:51:26 +00:00
feat(nodes): remote ingress via Traefik file provider
Remote replicas publish an ephemeral host port; the agent reports the assigned binding back in the create_container result and the backend renders a per-service file-provider config into TRAEFIK_DYNAMIC_DIR pointing Traefik at the node's mesh IP + port. Routes are rewritten on every remote reconcile and removed on teardown or local placement. Also: RetireService retires remote leftovers when a service returns to local placement; remove_container is idempotent agent-side; tombstoned replicas skip remove dispatch; the domains-stay-local ceiling is gone. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
4458de56b0
commit
c3a35081d0
13 files changed
+374
-39
No files matched your search
@@ -32,6 +32,9 @@ type NodeRunner interface {
|
||||
// RemoteRuntimeState reads the service's remote replicas from inventory
|
||||
// across all agents. nil/empty means nothing runs remotely.
|
||||
RemoteRuntimeState(ctx context.Context, serviceID string) (*RuntimeState, error)
|
||||
// RetireService removes every remote replica of the service across all
|
||||
// agents — used when a service returns to local placement.
|
||||
RetireService(ctx context.Context, serviceID string) error
|
||||
}
|
||||
|
||||
type DeploymentEngine struct {
|
||||
|
||||
@@ -182,6 +182,12 @@ func (de *DeploymentEngine) ReconcileService(ctx context.Context, spec RuntimeSp
|
||||
}
|
||||
return de.nodeRunner.ReconcileAuto(ctx, spec)
|
||||
}
|
||||
// Local placement: retire any remote leftovers from a previous pin,
|
||||
// spread, or tag affinity before reconciling local replicas.
|
||||
if de.nodeRunner != nil {
|
||||
_ = de.nodeRunner.RetireService(ctx, spec.ServiceID)
|
||||
}
|
||||
|
||||
if spec.Replicas < 1 {
|
||||
spec.Replicas = 1
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user