Skip to content

feat: allocate a loopback address per application - #137

Merged
dwilding merged 1 commit into
mainfrom
allocate-loopbacks
Nov 5, 2026
Merged

dwilding merged 1 commit into
mainfrom
allocate-loopbacks

Conversation

@dwilding

@dwilding dwilding commented Nov 4, 2026 •

Copy link
Copy Markdown
Owner

This PR extends the port detection introduced in #130.

Each application that is intended to be reachable from the host (the workload + COS applications) is assigned an address from 127.220.1.1, 127.220.1.2, etc, taking the first address that is not already allocated:

  • In the case of the workload, we allocate the first available address for which all dialed ports are available. "Dialed ports" meaning ports over which the integration tests attempt to connect to the unit.
  • In the case of COS applications, we allocate the first available address for which the application's well-known port is available. E.g., 3100 for Loki.

127.220.1.n:<port> maps to <ip>:<port>, where <ip> is the container IP.

This is prep work for:

  1. Outputting 127.220.1.n:<port> as the workload address, instead of the container IP. <port> will be the last in the set that was dialed by a passing integration test - as in #130.

  2. Rootless Podman support, where it won't be possible to connect to container IPs from the host. Our juju status command will report the allocated 127.220.1.n as the unit IP.


This PR also adjusts the --stable-port address from #133. The address is now 127.220.0.1. Additionally, specifying --stable-port will force the workload to use 127.220.0.1 as its allocated address, instead of 127.220.1.n. All dialed ports are published on 127.220.0.1. We don't care which dialed port is the last that came from a passing integration test - jjx outputs the port given by --stable-port.

The switch from 127.0.0.220 to 127.220.0.1 is the only change to jjx output in this PR.

@dwilding dwilding changed the title refactor: allocate a loopback address per application feat: allocate a loopback address per application Nov 4, 2026
@dwilding
dwilding merged commit 0fac71f into main Nov 5, 2026
17 checks passed
@dwilding
dwilding deleted the allocate-loopbacks branch November 5, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant