Repository navigation
docs(examples): add kubernetes-session-teleport-headscale to teleport over a self-hosted Headscale tailnet - #1674
Merged
Conversation
… over a self-hosted Headscale tailnet The Headscale twin of kubernetes-session-teleport-netbird: infer-local, infer-k8s and the gateway are tailnet nodes with tagged, ephemeral, reusable pre-auth keys, admitted hop by hop by two ACLs and running mutual TLS. Headscale serves HTTPS from the demo CA and runs its embedded DERP and STUN, so no traffic uses a public relay. The operator's Gateway cannot take a tailscale sidecar yet (inference-gateway/operator#316), so the gateway node is a tailscale proxy that forwards TCP 8443 to the Service of tokenless or of the operator's Gateway, with TLS end to end. Closes #1665
…th operator v0.32.0 Operator v0.32.0 takes sidecar containers and volumes in spec.pod, so the Gateway joins the tailnet itself and the standalone tailscale proxy pod is gone. tokenless carries the same sidecar in its Deployment, and the NetworkPolicy gateway-wireguard-only admits only WireGuard to the gateway's pods. - operator:install pins v0.32.0 and applies server-side, since the CRDs outgrew a client-side apply. - gateway:real deletes the earlier Gateway and infer-k8s and their offline nodes first, so the new pods get the plain names. - gateway:real and local:up wait until infer-local reaches infer-k8s:52789. Closes #1675
4 tasks done
edenreich
added a commit
that referenced
this pull request
Nov 1, 2026
…es (#1676) ## Summary An enabled daemon binding with neither a token nor TLS client certificates uses this machine's local token, `~/.infer/daemon/binding.token`, as `docs/daemon.md` describes. The daemon and the `chat --daemon` TUI filled it in, but `LocalDialConfig` did not. So on a machine without `infer init`, which seeds `browser_use`'s fallback token, every `infer daemon` client command (`workspaces`, `teleport`, `run`, `stop`) was refused with `ErrNoBinding` while the daemon was up and listening. `LocalDialConfig` now fills the local token first, so every local client agrees with the daemon on it. `ErrNoBinding` is left for a binding that is off, and its message says only that. Found while testing the Tailscale mode of the session teleport example (#1674), where infer-local runs on the host with its own `HOME`. ## Test plan - [x] `TestLocalDialConfigDialsWithTheBindingsCredentials`: an enabled binding with no token and no client certificates now dials with the local token the daemon reads, instead of failing with `ErrNoBinding` - [x] `go test ./internal/daemon/ ./cmd/daemon/ ./internal/presentation/tui/daemonthread/ ./internal/tools/ ./cmd/chat/` - [x] By hand, in a fresh `HOME` without `infer init` and a `daemon.yaml` with only `binding.enabled` and a port: `infer daemon`, then `infer daemon workspaces` lists the workspaces (refused before) - [x] `task precommit:run`
…nt with TAILNET=tailscale TAILNET=tailscale runs the same chain on your Tailscale tailnet, with your own machine as infer-local on its Tailscale app. Headscale stays the default. - tailscale:keys mints one tagged, ephemeral, reusable, pre-approved auth key per cluster node through the Tailscale API, from an OAuth client whose tag tag:infer-demo owns the node tags. - The manifests are rendered with the tailnet's DNS name and control URL. - infer-local runs infer built from this checkout under its own HOME, with a daemon that local:up starts and local:down stops. - gateway:real and cleanup remove the demo's old nodes through the API, and cleanup revokes the keys. The tasks never write your policy file. - infer-local's own binding serves tls.mode ca, so its commands authenticate with x509 too. - The canary is a UDP datagram from a container beside the cluster, and attack reads tailnet addresses from each pod's own sidecar, so neither needs Headscale.
Contributor
|
🎉 This PR is included in version 0.240.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
examples/kubernetes-session-teleport-headscale, the Headscale twin ofexamples/kubernetes-session-teleport-netbird. It runs the same chain and the same checks on a self-hosted Headscale tailnet:derp.urls: []), so nothing leaves the cluster. MagicDNS names live undertailnet.internal.infer-k8s, the gateway and the attacker run atailscale/tailscalev1.104.4 sidecar in kernel mode, andinfer-localruns one beside the cluster in compose. The sidecar rewrites the pod's sharedresolv.conf, andoverride_local_dns: falsekeeps cluster names resolving.headscale/policy.hujsonholds two ACLs,tag:infer-local → tag:infer-k8s:52789andtag:infer-k8s → tag:gateway:8443. The attacker's tag gets none.Gatewaycarries it throughspec.pod.containersandspec.pod.volumes(operator v0.32.0, feat(pod): add sidecar containers and volumes to spec.pod operator#317). The NetworkPolicygateway-wireguard-onlyadmits only WireGuard to the gateway's pods, so port 8443 is reachable over the tailnet alone.task gateway:realremoves the earlier gateway and its offline node before it creates theGateway, so the new pod gets the namegateway. The operator installs withkubectl apply --server-side, because the v0.32.0 CRDs are too large for a client-side apply.gateway:realandlocal:upreturn only once infer-local reachesinfer-k8s:52789.binding.tls.mode: files, ECDSA P-256), which keeps mutual TLS andforward_env. Headscale v0.29 cannot provisiontailscale servecertificates (hscontrol: implement tailscale cert and HTTPS serve juanfont/headscale#3554 is on its main branch only). The README coverstailscale serveas the Tailscale-only option withoutforward_env.task up TAILNET=tailscaleruns the same chain on your own Tailscale account, with your machine as infer-local on its Tailscale app. The choice is recorded in.state/, so later tasks need no flag. What changes:tag:infer-demo, which owns the node tags, because a client holding several tags is refused a key with just one of them.<node>.<tailnet>.ts.net, read from the Tailscale app. The manifests are rendered withsed, and the Headscale default is the identity.inferbuilt from this checkout, withHOMEunder.state/and its binding on loopback 52790, so your own~/.inferand daemon stay untouched.local:upstarts its daemon and waits until infer-k8s is reachable.gateway:realandcleanupremove the demo's old nodes through the API, andcleanuprevokes the keys. They only touch ephemeral devices namedinfer-k8s,gatewayorattackerthat carry nothing but the demo's tags.task tailscale:policyprintstailscale/policy.hujsonwith your login filled in.binding.tls.mode: ca, so its CLI commands authenticate with a client certificate from the daemon's CA. Loopback alone would let any local process or web page drive the daemon.attackreads tailnet addresses from each pod's own sidecar. The tokenless reply says "reached over the tailnet".The docs changes:
docs/examples.mdlists the example.docs/daemon.md"Daemons on other machines" links it, and mentions the Tailscale mode.Closes #1665
Closes #1675
Test plan
task up workspaces sniff:start demo secret:check sniff:report attack tailnet:status teleport:back cleanupDEMO_SECREThashes match with the value in no pod spec.certificate requiredwithout the client certificate, and infer-local cannot resolve the gateway.infer-k8sreaches both neighboursdirect, the gateway at its own pod address, and the teleport back works.task up TAILNET=tailscale workspaces sniff:start demo secret:check sniff:report attack tailnet:status teleport:back cleanupinfer-k8s,gatewayandattackeronline in the tailnet with their tags.infer-k8s.<tailnet>.ts.netdirectly, the turn goes through the gateway, and theDEMO_SECREThashes match.cleanupleaves no demo node in the tailnet, no cluster, no containers, no daemon and no.state/.task gateway:real PROVIDER=ollama_cloud MODEL=ollama_cloud/glm-5.3-flashon Headscale (twice) and on TailscaleGatewaypod joins asgatewaythrough itsspec.pod.containerssidecar, also after the earlier one is deleted.task demogets a real answer each time.tskey-appear 0 times in the task output.task precommit:run