How render-examples/tailscale works
Project type and purpose
• This is an infrastructure‐as‐code example repo that deploys a single Docker service on Render.
• Purpose: run a Tailscale subnet router in a Render Private Network, allowing zero-config VPN access (WireGuard-based) to all internal 10.x.x.x services.
File structure
• Dockerfile – builds the container image with Tailscale and helper scripts.
• install-tailscale.sh / run-tailscale.sh – shell scripts to install and launch the Tailscale daemon in the container.
• render.yaml – Render’s service definition (environment variables, build & run commands).
• README.md – usage instructions and high-level architecture.
README for additional insights
• Shows that the container needs a TAILSCALE_AUTHKEY (one-time key) set in Render.
• Describes the subnet-router role: advertise and enable subnet routes via the Tailscale admin panel.
• Mentions interaction with Render private services via DNS + dig.
Main components and their relationships
a. Render Platform
– Build & deploy pipeline (reads Dockerfile + render.yaml).
– Hosts the Docker container as a managed service.
b. Docker Container (Subnet Router)
– Contains Tailscale daemon (installed by install-tailscale.sh).
– run-tailscale.sh boots the daemon with the AUTHKEY and registers as a subnet router.
c. Tailscale Control Plane (Tailnet)
– Coordination servers that accept AUTHKEY, authenticate, and distribute peer info.
d. Render Private Network
– Virtual network overlay (10.x.x.x) where your private services live.
– Container advertises routes into this network.
e. Other Private Services on Render
– Any other Render services marked “private” (they get internal IPs).
– DNS names resolvable from within the subnet router container.
f. End Users / Clients
– Machines on your Tailscale Tailnet.
– Access private services through the subnet router.
Interactions & data flows
1. Deploy pipeline pushes container to Render.
2. Container starts and runs run-tailscale.sh:
– Connects to Tailscale control plane using AUTHKEY.
– Registers as a subnet router; advertises 10.x.x.x/ routes.
3. Tailscale admin panel: operator enables advertised subnets in Tailnet settings.
4. Tailnet clients query Tailscale DNS for private service hostnames → packets flow over WireGuard tunnels to the subnet router.
5. Subnet router forwards traffic into the Render private network to the target service IPs.
Architectural patterns & design principles
• Single‐purpose container: minimal OS + scripts + Tailscale daemon.
• Clear separation of control plane (Tailscale servers) vs. data plane (WireGuard tunnels).
• Infrastructure‐as‐code: Dockerfile + shell scripts + render.yaml define build and deploy.
• Use of environment variables (TAILSCALE_AUTHKEY) for secrets injection.
Final checklist
[ ] Clear labels on all six main components
[ ] Annotation of any manual/admin steps (e.g., “Enable subnet routes in Tailnet admin UI”)