Files
computer-playbook/compose/swarm/compose.yml
T
kevinveenbirkenbachandClaude Opus 4.8 22fde6d285 fix(swarm-test): pin cluster node IPs and hostnames deterministically
Every DinD node is attached to a second network by the bootstrap cache connect, so the embedded DNS returns two A records per node name in undefined order; workers that resolved the manager onto the cache network could not reach the registry bound to the lab IP and rejected locally built images with 'No such image', pushing all replicas onto the manager. Pin a fixed lab ipv4_address per node and every node name via extra_hosts (files-first resolution wins over DNS); the subnet and IPs live in default.env as the INFINITO_SWARM_* SPOT consumed by compose interpolation and the topology exports. Proven by A/B: the identical friendica variant-2 swarm job went from worker rejects to fully green including the drain test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-22 20:50:16 +02:00

85 lines
2.9 KiB
YAML

x-node: &node
image: infinito-swarm-node
build:
context: .
args:
INFINITO_IMAGE: "${INFINITO_IMAGE:?run make dotenv / build the distro image first}"
privileged: true
cgroup: host
security_opt:
- seccomp=unconfined
- apparmor=unconfined
tmpfs:
- /run
- /run/lock
labels:
- "${INFINITO_SWARM_TEST_LABEL:?run utils/topology/export.sh first}="
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /lib/modules:/lib/modules:ro
extra_hosts:
- "${MGR:?run utils/topology/export.sh first}:${INFINITO_SWARM_MGR_IP:?run utils/topology/export.sh first}"
- "${WRK1:?run utils/topology/export.sh first}:${INFINITO_SWARM_WRK1_IP:?run utils/topology/export.sh first}"
- "${WRK2:?run utils/topology/export.sh first}:${INFINITO_SWARM_WRK2_IP:?run utils/topology/export.sh first}"
- "${NFS_SERVER:?run utils/topology/export.sh first}:${INFINITO_SWARM_NFS_IP:?run utils/topology/export.sh first}"
- "${BACKUP_NODE:?run utils/topology/export.sh first}:${INFINITO_SWARM_BACKUP_IP:?run utils/topology/export.sh first}"
services:
nfs-server:
<<: *node
container_name: "${NFS_SERVER:?run utils/topology/export.sh first}"
hostname: "${NFS_SERVER:?run utils/topology/export.sh first}"
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
- /lib/modules:/lib/modules:ro
- "nfs-export:${NFS_EXPORT_BASE:?run utils/topology/export.sh first}"
networks:
lab:
ipv4_address: "${INFINITO_SWARM_NFS_IP:?run utils/topology/export.sh first}"
swarm-mgr-01:
<<: *node
container_name: "${MGR:?run utils/topology/export.sh first}"
hostname: "${MGR:?run utils/topology/export.sh first}"
networks:
lab:
ipv4_address: "${INFINITO_SWARM_MGR_IP:?run utils/topology/export.sh first}"
swarm-wrk-01:
<<: *node
container_name: "${WRK1:?run utils/topology/export.sh first}"
hostname: "${WRK1:?run utils/topology/export.sh first}"
networks:
lab:
ipv4_address: "${INFINITO_SWARM_WRK1_IP:?run utils/topology/export.sh first}"
swarm-wrk-02:
<<: *node
container_name: "${WRK2:?run utils/topology/export.sh first}"
hostname: "${WRK2:?run utils/topology/export.sh first}"
networks:
lab:
ipv4_address: "${INFINITO_SWARM_WRK2_IP:?run utils/topology/export.sh first}"
backup-host:
<<: *node
container_name: "${BACKUP_NODE:?run utils/topology/export.sh first}"
hostname: "${BACKUP_NODE:?run utils/topology/export.sh first}"
profiles: ["drill"]
networks:
lab:
ipv4_address: "${INFINITO_SWARM_BACKUP_IP:?run utils/topology/export.sh first}"
volumes:
nfs-export:
networks:
lab:
name: "${SWARM_LAB_NETWORK:?run utils/topology/export.sh first}"
driver: bridge
driver_opts:
com.docker.network.driver.mtu: "1400"
ipam:
config:
- subnet: "${INFINITO_SWARM_LAB_SUBNET:?run utils/topology/export.sh first}"