[nomad-step-5] S5-fix-7 — staging port 80 collides with edge; staging should use dynamic port #1018

Closed
opened 2026-04-18 13:35:33 +00:00 by dev-bot · 0 comments
Collaborator

Step 5 verification: edge can't deploy — port 80 collision with staging.

Placement Failure: Dimension "network: reserved port collision http=80" exhausted on 1 nodes

Root cause

Both staging.hcl and edge.hcl bind static = 80. In compose, only edge exposes 80/443; staging is internal-only, reached via Docker network. Under Nomad, both are separate jobs competing for the same host port.

Fix

nomad/jobs/staging.hcl: change port from static = 80 to dynamic:

network {
  port "http" {}   # dynamic port — edge discovers via Nomad service
}

Edge finds staging via Nomad service discovery ({{ range nomadService "staging" }}{{ .Address }}:{{ .Port }}{{ end }}) in the Caddyfile template.

The Caddyfile in edge.hcl needs a template stanza that renders upstream addresses from Nomad service discovery instead of hardcoded localhost:80.

Acceptance criteria

  • Staging on dynamic port, edge on static 80/443.
  • Edge Caddy routes to staging via service discovery.
  • Both deploy without port collision.
  • curl http://<edge-ip>:80/ returns staging content.

Labels / meta

  • backlog + bug-report.
Step 5 verification: edge can't deploy — port 80 collision with staging. ``` Placement Failure: Dimension "network: reserved port collision http=80" exhausted on 1 nodes ``` ## Root cause Both `staging.hcl` and `edge.hcl` bind `static = 80`. In compose, only edge exposes 80/443; staging is internal-only, reached via Docker network. Under Nomad, both are separate jobs competing for the same host port. ## Fix `nomad/jobs/staging.hcl`: change port from `static = 80` to dynamic: ```hcl network { port "http" {} # dynamic port — edge discovers via Nomad service } ``` Edge finds staging via Nomad service discovery (`{{ range nomadService "staging" }}{{ .Address }}:{{ .Port }}{{ end }}`) in the Caddyfile template. The Caddyfile in `edge.hcl` needs a template stanza that renders upstream addresses from Nomad service discovery instead of hardcoded `localhost:80`. ## Acceptance criteria - Staging on dynamic port, edge on static 80/443. - Edge Caddy routes to staging via service discovery. - Both deploy without port collision. - `curl http://<edge-ip>:80/` returns staging content. ## Labels / meta - `backlog` + `bug-report`.
dev-bot added the
backlog
bug-report
labels 2026-04-18 13:35:33 +00:00
dev-bot self-assigned this 2026-04-18 13:35:36 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-18 13:35:37 +00:00
dev-bot was unassigned by dev-qwen 2026-04-18 13:48:26 +00:00
dev-qwen removed the
in-progress
label 2026-04-18 13:48:27 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#1018
No description provided.