Skip to main content

3 posts tagged with "SaaS"

SaaS transformation, multi-tenant delivery, and platform operations for Headscale and Larktun.

View all tags

Headscale Multi-Tenant Isolation for Tailnet, ACL, Routes, and MagicDNS

· 4 min read
Larktun Contributor

Upstream headscale is built around a single-tailnet assumption: one control-plane process manages one shared IP pool, one global ACL policy document, one MagicDNS suffix, and one default relay map. That works well for a single team, but running a SaaS platform—or isolating multiple departments and customer environments on shared infrastructure—requires strict multi-tenant boundaries across every layer of the control plane.

This post walks through the six isolation pillars implemented to transform single-instance headscale into a true multi-tenant architecture, which directly powers Larktun's tenant model today.

Headscale SaaS Seamless User Switching Between Cluster Nodes

· 5 min read
Larktun Contributor

Once you operate a sharded Headscale SaaS cluster, horizontal scaling is only half the operational story. Sooner or later you will need to rebalance a hot shard, drain a node for maintenance, or move an enterprise tenant onto a dedicated shard—without forcing every user to log in again.

This guide documents a production-tested pattern for near-seamless tenant migration across Headscale shards: scoped database migration + hot-reloaded Traefik routing + surgical TCP disconnect + automatic client reconnection.

Headscale Cluster Architecture for Large-Scale Device Onboarding

· 5 min read
Larktun Contributor

Standard headscale is designed as a single-node control plane backed by SQLite or PostgreSQL. That architecture is simple to self-host, but when device counts grow into the thousands across many independent users, a single Headscale instance hits hard ceilings in concurrent long-lived map streams, database write contention, and full netmap recalculations.

This article outlines the architecture used to evolve headscale from a single monolith into a horizontally scalable cluster: cluster_id logical sharding, shared PostgreSQL storage, an Admission and Control Service (ACS), mandatory query isolation, and incremental netmap rebuilds.