Article · 3 min read · Home lab
The mesh server standby
Connections already made between your devices carry on without the mesh server, and relays include Tailscale’s public ones. But a device that restarts, or a new one, needs the mesh server to join. So kubespin keeps a standby copy of your [[
Connections already made between your devices carry on without the mesh server, and relays include Tailscale’s public ones. But a device that restarts, or a new one, needs the mesh server to join. So kubespin keeps a standby copy of your mesh server on another of your servers, ready to take over.
Where it runs
kubespin chooses the standby itself: another of your servers, not the mesh server, with a public address, Docker, and ports 443/tcp and 3478/udp free. If it stops qualifying, kubespin chooses again.
What happens
- Every 5 minutes kubespin copies the mesh server’s database (an online copy) and its keys to the standby, with the same settings, so your devices trust it as the same server.
- Every minute a timer on the standby asks the mesh server whether it’s answering.
- After 3 misses the standby starts its own Headscale, gets its own certificate from Let’s Encrypt, and points the mesh’s name at itself in your DNS. Your devices carry on through it.
- When the mesh server has answered for 5 minutes in a row, the standby points the name back and stops.
The mesh’s name has a DNS record of its own, so a takeover changes only that one name. kubespin never copies over a standby that has taken over.
What isn’t copied back: a device that joined while the standby was in charge joins again afterwards.
In kubespin
Nothing to set up. Once you have a mesh server and a second server that qualifies, the standby follows by itself. You need a domain connected on DNS › Domains, since the takeover changes the mesh’s name there (kubespin: Your own domains).
For whoever runs kubespin
kubespin’s own shared mesh server, for accounts without a mesh server of their own, has the same standby on one of the admins’ servers that isn’t kubespin’s host. Admin › Names shows where it is, when it was last copied, and whether it has taken over, with Copy now. The standby changes the mesh’s name through kubespin’s DNS provider in Admin › Names, or, without one, through an admin’s own connected domain holding that name. The key is kept on the standby, readable by root only.
GET /api/v1/admin/names/mesh-standby returns the same, and POST /api/v1/admin/names/mesh-standby/sync copies now. Both are for superadmins.