Skip to content

port

kind: port
name: web
spec:
preferred: 3010
range: [3000, 3999]
domains: [web.localhost, https://web.example.dev]
field default
preferred the port to try first none
range [lo, hi], searched when preferred is taken or absent [3000, 3999]
domains hosts the proxy serves this port at: a bare host (web.localhost) or a URL (https://web.example.dev) []
domain one entry, sugar for domains: [x]; not together with domains

The value is allocated by probing a bind on 127.0.0.1 and releasing it, preferred first, then the range from lo. A running port keeps its value across re-applies while it still fits the spec, and across daemon upgrades.

{ "value": 3010, "url": "http://web.localhost", "urls": ["http://web.localhost", "https://web.example.dev"] }

value is the port. With domains, urls has one URL per entry in spec order and url is the first; see Domains and the proxy for what each form publishes.

Other resources read it as ${ port.web.status.value } and are held Pending until the port is allocated:

kind: process
name: web
spec:
cmd: pnpm
args: [dev, --port, "${ port.web.status.value }"]
health:
web:
http: { port: "${ port.web.status.value }" }