dind: split DNS -- ts.net via MagicDNS, everything else via Cloudflare
The host resolves the tailnet through MagicDNS on tailscale0 and everything else through Cloudflare (systemd-resolved split DNS). MagicDNS has no upstream for names outside the tailnet and answers them SERVFAIL, so handing 100.100.100.100 to job containers as their first resolver made every public lookup wait on a failure before falling back: image pulls stalled and the e2e lane's *.localtest.me fetches blew a 5s poll. A CoreDNS forwarder at a fixed address on the runner network now answers both: ts.net is forwarded to MagicDNS, the rest to 1.1.1.1/1.0.0.1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018j9YG8YFjcsVLnqzNz7LmA
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
# Split-horizon resolver for the runner's Docker daemon and every job
|
||||||
|
# container it starts.
|
||||||
|
#
|
||||||
|
# The host resolves the tailnet through MagicDNS on tailscale0 and everything
|
||||||
|
# else through Cloudflare on the default link (systemd-resolved split DNS).
|
||||||
|
# MagicDNS itself has no upstream configured for names outside the tailnet and
|
||||||
|
# answers them with SERVFAIL, so handing 100.100.100.100 to job containers as
|
||||||
|
# their first resolver made every public lookup (image pulls, *.localtest.me
|
||||||
|
# in the e2e lanes) wait on a failure before falling back -- long enough to
|
||||||
|
# time out a 5s Playwright poll. Only ts.net goes to MagicDNS here.
|
||||||
|
ts.net:53 {
|
||||||
|
errors
|
||||||
|
forward . 100.100.100.100
|
||||||
|
}
|
||||||
|
.:53 {
|
||||||
|
errors
|
||||||
|
cache 30
|
||||||
|
forward . 1.1.1.1 1.0.0.1
|
||||||
|
}
|
||||||
+20
-2
@@ -1,4 +1,17 @@
|
|||||||
services:
|
services:
|
||||||
|
# Split DNS for the dind daemon and its job containers: ts.net -> MagicDNS,
|
||||||
|
# everything else -> Cloudflare. See Corefile for why MagicDNS alone fails.
|
||||||
|
dns:
|
||||||
|
image: coredns/coredns@sha256:af8c8d35a5d184b386c4a6d1a012c8b218d40d1376474c7d071bb6c07201f47d
|
||||||
|
container_name: gitea-runner-dns
|
||||||
|
restart: unless-stopped
|
||||||
|
command: ["-conf", "/Corefile"]
|
||||||
|
volumes:
|
||||||
|
- ./Corefile:/Corefile:ro
|
||||||
|
networks:
|
||||||
|
runner:
|
||||||
|
ipv4_address: 172.28.0.53
|
||||||
|
|
||||||
# Isolated Docker daemon for the runner's job containers.
|
# Isolated Docker daemon for the runner's job containers.
|
||||||
# Keeps the host Docker clean and gives reliable cache networking.
|
# Keeps the host Docker clean and gives reliable cache networking.
|
||||||
dind:
|
dind:
|
||||||
@@ -37,12 +50,14 @@ services:
|
|||||||
# own network, and a killed job leaves one behind. 10.210/16 in /24s is 256
|
# own network, and a killed job leaves one behind. 10.210/16 in /24s is 256
|
||||||
# networks and collides with nothing here (no 10.x route on the host; the
|
# networks and collides with nothing here (no 10.x route on the host; the
|
||||||
# tailnet is 100.64/10).
|
# tailnet is 100.64/10).
|
||||||
command: ["dockerd", "--host=tcp://0.0.0.0:2375", "--host=unix:///var/run/docker.sock", "--host=unix:///dind-sock/docker.sock", "--tls=false", "--dns=100.100.100.100", "--dns=1.1.1.1", "--default-address-pool", "base=10.210.0.0/16,size=24"]
|
command: ["dockerd", "--host=tcp://0.0.0.0:2375", "--host=unix:///var/run/docker.sock", "--host=unix:///dind-sock/docker.sock", "--tls=false", "--dns=172.28.0.53", "--dns=1.1.1.1", "--default-address-pool", "base=10.210.0.0/16,size=24"]
|
||||||
environment:
|
environment:
|
||||||
DOCKER_TLS_CERTDIR: ""
|
DOCKER_TLS_CERTDIR: ""
|
||||||
dns:
|
dns:
|
||||||
|
- 172.28.0.53
|
||||||
- 1.1.1.1
|
- 1.1.1.1
|
||||||
- 1.0.0.1
|
depends_on:
|
||||||
|
- dns
|
||||||
networks:
|
networks:
|
||||||
- runner
|
- runner
|
||||||
volumes:
|
volumes:
|
||||||
@@ -92,6 +107,9 @@ services:
|
|||||||
|
|
||||||
networks:
|
networks:
|
||||||
runner:
|
runner:
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 172.28.0.0/24
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
dind-storage:
|
dind-storage:
|
||||||
|
|||||||
Reference in New Issue
Block a user