docs/gotchas: correct network-isolation description (it's the only mode now, not opt-in)
This commit is contained in:
parent
fcdba9e681
commit
07f4b96a72
1 changed files with 22 additions and 13 deletions
|
|
@ -30,19 +30,28 @@ Not `boot.isContainer = true`. Renamed in nixos-25.11+.
|
||||||
|
|
||||||
…in the `.conf`. The start script's `if HOST_ADDRESS set →
|
…in the `.conf`. The start script's `if HOST_ADDRESS set →
|
||||||
--network-veth` branch then forces a private netns — silently fatal
|
--network-veth` branch then forces a private netns — silently fatal
|
||||||
for our web UIs (the bind is invisible from the host). By default we
|
for our web UIs (the bind is invisible from the host).
|
||||||
force-clear `HOST_ADDRESS` / `LOCAL_ADDRESS` / `HOST_ADDRESS6` /
|
`hive-priv`'s `write_nspawn_flags` rewrites these vars every time it
|
||||||
`LOCAL_ADDRESS6` / `HOST_BRIDGE` and set `PRIVATE_NETWORK=0`
|
touches the conf file, and which way it writes them depends on
|
||||||
(`hive-priv`'s `write_nspawn_flags`).
|
`HIVE_NETWORK_ISOLATION`:
|
||||||
|
|
||||||
When `HIVE_NETWORK_ISOLATION=1` is set (the `hive-network.nix` module's
|
- **Every real deployment today**: `hive-network.nix` sets
|
||||||
`isolateContainers` option), the same function takes the opposite
|
`HIVE_NETWORK_ISOLATION=1` unconditionally whenever hyperhive is
|
||||||
branch instead: `PRIVATE_NETWORK=1` plus a veth pair onto the host
|
enabled — there's no opt-out any more (`isolateContainers` and the
|
||||||
bridge, `HOST_ADDRESS` set to the bridge gateway IP (so
|
module's own `enable` option were both removed via
|
||||||
`nixos-container`'s in-container init installs a default route before
|
`lib.mkRemovedOptionModule`; "network isolation is the only mode" is
|
||||||
the DHCP lease arrives), and the rest left for DHCP. Isolation is a
|
the removal message itself). So `write_nspawn_flags` takes the
|
||||||
per-host opt-in, not the default — most hosts still take the
|
`isolation: Some` branch: `PRIVATE_NETWORK=1` plus a veth pair onto
|
||||||
force-clear branch above.
|
the host bridge, `HOST_ADDRESS` set to the bridge gateway IP (so
|
||||||
|
`nixos-container`'s in-container init installs a default route
|
||||||
|
before the DHCP lease arrives), rest left for DHCP.
|
||||||
|
- The `None` branch — force-clear `HOST_ADDRESS` / `LOCAL_ADDRESS` /
|
||||||
|
`HOST_ADDRESS6` / `LOCAL_ADDRESS6` / `HOST_BRIDGE` and
|
||||||
|
`PRIVATE_NETWORK=0` — only fires when `HIVE_NETWORK_ISOLATION` isn't
|
||||||
|
`"1"` at all (env var unset) or the bridge subnet fails to parse
|
||||||
|
(`bridge_gateway_ip` returns `None`, logged as a warning). Not a
|
||||||
|
supported alternate mode any more, just what the code falls back to
|
||||||
|
outside the one path every host actually takes.
|
||||||
|
|
||||||
### systemd service PATH ≠ host PATH
|
### systemd service PATH ≠ host PATH
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue