agent: golden P2B — controller container gets /mnt:rslave + /mnt made rshared
build-golden.sh bootstrap makes /mnt a shared mount and binds it :rslave into the controller container so enrolled data drives (and P3 self-heal remounts) propagate in. Scoped to /mnt (Model A: only felhom-data-namespace mounts). Spike-proven. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+13
-5
@@ -126,16 +126,24 @@ docker rm -f felhom-controller >/dev/null 2>&1 || true
|
||||
# creates empty dirs → every bind-mounted stack (base infra AND customer apps) breaks. A named volume
|
||||
# would NOT fix this (it resolves to /var/lib/docker/volumes/...). Pre-create the dir, then same-path bind.
|
||||
mkdir -p /opt/docker/stacks
|
||||
# slice 8C: the controller is DE-PRIVILEGED — disk execution (scan/format/mount/migrate) is the
|
||||
# host agent's job now, so this run grants NO disk privileges: no --privileged, no /dev, no
|
||||
# /etc/fstab, no rshared /mnt. Only the bootstrap config (ro), the data volume, the stacks dir
|
||||
# (same-path host bind), and the docker socket (app/stack management). The controller reaches the
|
||||
# agent's local API for disk management.
|
||||
# slice 10 P2: the controller must SEE enrolled external data drives, which the agent binds into the
|
||||
# guest at /mnt/<name>. Make /mnt a SHARED mount so those binds (and later host-remount self-heal)
|
||||
# propagate into the controller container, then bind /mnt :rslave (host->container propagation ONLY —
|
||||
# the container can't mutate the guest mount tree). This is the ONE bind the 8C de-privileging left
|
||||
# out; scoped to /mnt, which (Model A) holds only Felhom's felhom-data-namespace mounts, never the
|
||||
# customer's other on-drive data. rbind preserves existing submounts; re-running re-shares (safe).
|
||||
mkdir -p /mnt
|
||||
mountpoint -q /mnt || mount --rbind /mnt /mnt
|
||||
mount --make-rshared /mnt
|
||||
# Otherwise still DE-PRIVILEGED: disk EXECUTION (scan/format/mount) stays the agent's — NO --privileged,
|
||||
# no /dev, no /etc/fstab. Bootstrap config (ro), data volume, stacks dir (same-path), the /mnt :rslave
|
||||
# view, and the docker socket. The controller reaches the agent's local API for disk management.
|
||||
docker run -d --name felhom-controller --restart unless-stopped "${HOSTNAME_ARGS[@]}" \
|
||||
-e FELHOM_BOOTSTRAP_PATH=/etc/felhom-bootstrap/bootstrap.json \
|
||||
-v /etc/felhom-bootstrap:/etc/felhom-bootstrap:ro \
|
||||
-v felhom-controller-data:/opt/docker/felhom-controller \
|
||||
-v /opt/docker/stacks:/opt/docker/stacks \
|
||||
-v /mnt:/mnt:rslave \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
"$IMAGE"
|
||||
echo "[ctrl-bootstrap] controller started"
|
||||
|
||||
Reference in New Issue
Block a user