Using Tailscale with Kubernetes: Pod as a Client with Exit Node

Tailscale makes it incredibly easy to build secure, private networks between devices — and it works brilliantly inside Kubernetes too. In this guide, we’ll run a Kubernetes pod as a Tailscale client, routing its egress traffic through a Tailscale exit node. ✅ Use case: You want a pod to access the internet through a specific IP/location (e.g., a static home server) while maintaining full mesh connectivity over Tailscale. 🧱 Requirements A Kubernetes cluster (k3s, k8s, or managed service) A working Tailscale account An exit node already configured and enabled in Tailscale Linux container support (Debian-based preferred for Tailscale) 🐳 Step 1: Create a Tailscale-enabled Pod Here’s a basic example using an init container to authenticate and set up Tailscale. ...

March 21, 2024