Repository navigation
Description
Summary
Add examples/kubernetes-session-teleport-headscale, the Headscale twin of examples/kubernetes-session-teleport-netbird. A session teleports from infer-local (a container beside a k3d cluster) to infer-k8s (a pod), whose agent calls a gateway (tokenless, or the Inference Gateway with a real model). Every hop runs over a self-hosted tailnet behind its own policy and on mutual TLS. The README shows the same steps against Tailscale.
#1635 removed SPIFFE so that identity between machines comes from a VPN. docs/daemon.md ("Daemons on other machines") describes a remote daemon behind tailscale serve, and the NetBird example covers one VPN. This one covers Headscale and Tailscale.
What changes from the NetBird example is the VPN only:
- Headscale has no sidecar injector, so each tailnet pod carries a
tailscale/tailscalesidecar. - The operator
Gatewaytakes no extra containers, so the real gateway runs as a plain Deployment with the sidecar. - Headscale's embedded DERP and STUN replace NetBird's relay, so nothing leaves the cluster. Headscale serves HTTPS with a certificate from the demo CA.
Two TLS paths are worth showing:
- Daemon-terminated TLS (
tls.mode: fileson the tailnet address): works on Headscale and Tailscale and keepsforward_env. tailscale serve: terminates HTTPS with a*.ts.netcertificate in front of a loopback binding.forward_envdoes not work behind Serve, because the certificate's key belongs to Tailscale. Headscale v0.29.x cannot issue those certificates (hscontrol: implement tailscale cert and HTTPS serve juanfont/headscale#3554 is on its main branch and needs an ACME DNS-01 provider).
Acceptance Criteria
-
examples/kubernetes-session-teleport-headscale/mirrors the NetBird example's layout, with the VPN-specific files inheadscale/, anddocs/examples.mdlists it - Every node joins Headscale with a tagged, ephemeral pre-auth key, with no account and no API key (mock gateway by default)
- A Headscale policy lets only
infer-localreachinfer-k8s's binding port and onlyinfer-k8sreach the gateway port -
infer-localregistersinfer-k8saskind: daemonby its MagicDNS name, with mTLS andforward_env. The README states which TLS path supportsforward_env - The README walks through:
infer daemon workspacesshowing the peer reachableinfer daemon teleport <id> --to infer-k8s- a turn with
infer daemon run - the teleport back
- An attacker node outside the policy cannot resolve or reach either binding, and a capture on the node sees only WireGuard
-
task gateway:realswaps in the Inference Gateway with a real provider and model - The README shows the same setup against Tailscale (login server, auth keys, policy file)
-
task cleanupremoves everything the example created -
docs/daemon.md"Daemons on other machines" links the example
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][FEATURE] Add examples/tailscale-peers to secure daemon-to-daemon teleports with Headscale or Tailscale[/-][+][FEATURE] Add examples/kubernetes-session-teleport-headscale to teleport over a self-hosted Headscale tailnet[/+]inference-gateway-releaser commentedon Nov 1, 2026
🎉 This issue has been resolved in version 0.240.0 🎉
The release is available on:
Your semantic-release bot 📦🚀