Skip to content

Commit 654f5a7

Browse files
instruqt: fix GCP exit node routing deadlock
On GCP, rp_filter=2 alone is not enough. Tailscale's DERP and control plane connections lack SO_MARK, hitting table 52's default route via tailscale0 before the tunnel exists. Add a source-based ip rule at priority 100 so those connections bypass tailscale0 via the main table. Also add push-instruqt-tailscale.sh for pushing the track to Tailscale's Instruqt org.
1 parent f8d9fc2 commit 654f5a7

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

instruqt/01-hello-tailnet/setup-workshop

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ net.ipv4.conf.default.rp_filter = 2
6060
EOF
6161
sysctl --system
6262

63+
# rp_filter=2 alone is not sufficient on GCP. Tailscale's DERP and
64+
# control plane connections don't have SO_MARK set, so they hit table
65+
# 52's default route (via tailscale0) before the exit node tunnel
66+
# exists, deadlocking the bootstrap. This source-based rule ensures
67+
# all traffic from this VM's IP uses the main table directly.
68+
ip rule add from "$(ip route get 8.8.8.8 | grep -oP 'src \K\S+')/32" lookup main priority 100
69+
6370
# --- Local reverse proxy for Instruqt service tabs ---
6471
# Instruqt `service` tabs proxy VM ports, not tailnet URLs, and render
6572
# the proxied site inside an iframe. Caddy listens on :8233 and :80,

scripts/push-instruqt-tailscale.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/zsh
2+
set -euo pipefail
3+
4+
REPO_ROOT="$(git -C "$(dirname "$0")" rev-parse --show-toplevel)"
5+
INSTRUQT_DIR="$REPO_ROOT/instruqt"
6+
7+
# Patch track.yml for tailscale org
8+
sed -i '' 's/^owner: temporal/owner: tailscale/' "$INSTRUQT_DIR/track.yml"
9+
sed -i '' '/^id: /d' "$INSTRUQT_DIR/track.yml"
10+
sed -i '' '/mason\.egger@temporal\.io/d' "$INSTRUQT_DIR/track.yml"
11+
12+
# Clear challenge IDs
13+
for f in "$INSTRUQT_DIR"/*/assignment.md; do
14+
sed -i '' '/^id: /d' "$f"
15+
done
16+
17+
# Push (instruqt requires cwd to be the track directory)
18+
(builtin cd "$INSTRUQT_DIR" && instruqt track push --force)
19+
20+
# Restore so we don't accidentally commit the patched files
21+
git -C "$REPO_ROOT" checkout -- instruqt/

0 commit comments

Comments
 (0)