headscale
by SikaLabs
Headscale (with embedded DERP) and optional Headplane UI, packaged for multi-tenant installs
About this chart
headscale Helm Chart
Headscale (open-source Tailscale control server) packaged with an optional Headplane UI. This chart is built for multi-tenant installs, with configurable domains, DB/OIDC, DERP, and ACL policy.
- Headscale provides the control-plane and can serve an embedded DERP relay for TCP-based relay when UDP is blocked.
- Headplane is an optional web UI to manage Headscale via API.
Features
- Single or dual app deployment: enable only Headscale, only Headplane, or both.
- Embedded DERP behind your Ingress, with path-based routing (default
/derp). - ACL policy (HUJSON) via ConfigMap, hot-reload friendly.
- Pluggable DB and OIDC secrets (use existing or let chart create placeholders).
- PVCs for Headscale keys/config and Headplane data.
Requirements
- Kubernetes 1.22+
- Ingress controller (Nginx tested) when
ingress.enabled=true. - cert-manager if using auto TLS with chart annotations.
Quickstart
Install both Headscale and Headplane with defaults:
helm upgrade --install hs helm/headscale \
--namespace headscale --create-namespace
Install Headscale only (no Headplane):
helm upgrade --install hs helm/headscale \
--namespace headscale --create-namespace \
--set headplane.enabled=false
Provide real secrets at install time (recommended):
# DB password from file
helm upgrade --install hs helm/headscale \
-n headscale --create-namespace \
--set headscale.db.existingSecret= \
--set-file headscale.db.passwordKey=./db-password.txt
Or reference existing secrets:
helm upgrade --install hs helm/headscale \
-n headscale --create-namespace \
--set headscale.db.existingSecret=my-db-secret \
--set headscale.oidc.existingSecret=my-oidc-secret
How DERP is wired
- Embedded DERP is enabled by default and advertised on port 443.
- Traffic reaches Headscale via your Ingress at
https://<host>/derpand is proxied to the Headscale HTTP port (default 8080). TLS terminates at the Ingress. - UDP/STUN is required by Headscale v0.27 when DERP is enabled; the chart binds STUN to
127.0.0.1:3478so it’s not externally exposed.
If you hit issues with DERP via Ingress, consider:
- Switching to a dedicated LoadBalancer on 443 and adjusting
derp.derpPortaccordingly. - Using an Ingress controller with HTTP/2 support and long-lived connection timeouts (the chart sets long read/send timeouts by default).
Values reference
Top-level toggles:
headscale.enabled: Deploy Headscale (default true)headplane.enabled: Deploy Headplane (default true)
Headscale:
headscale.image.repository(defaultghcr.io/juanfont/headscale)headscale.image.tag(defaultv0.27.1)headscale.serverUrl: Public URL used in links and DERP advertisementheadscale.prefixes.v4,headscale.prefixes.v6: IP ranges to allocateheadscale.dns.baseDomain,headscale.dns.magicDNS,headscale.dns.nameserversGlobalheadscale.db.*: host, name, user, port, ssl, secret refheadscale.oidc.enabled,issuer,clientId,existingSecret,clientSecretKeyheadscale.derp.*:enabled,urls,derpPort,stunListenAddr,regionId/code/name,privateKeyPathheadscale.policy.create,headscale.policy.hujson: HUJSON ACL policyheadscale.persistence.*: PVC settings for/etc/headscaleheadscale.ingress.*: className, annotations,host, TLS secret,derpPath
Headplane:
headplane.image.repository,tagheadplane.config.server.cookieSecret: must be exactly 32 charsheadplane.config.headscale.internalUrl: in-cluster URL to Headscale (default points to this chart’s service)headplane.config.headscale.publicUrl: public URL (defaults toheadscale.serverUrl)headplane.persistence.*,headplane.ingress.*
Example: Headscale only, custom domains and DB
headscale:
enabled: true
serverUrl: https://vpn.acme.example
ingress:
host: vpn.acme.example
tls:
secretName: vpn-acme-example-tls
db:
host: postgres-rw.postgres.svc.cluster.local
name: headscale
user: headscale
existingSecret: acme-headscale-db
passwordKey: HEADSCALE_DATABASE_POSTGRES_PASS
derp:
enabled: true
urls: "" # only embedded DERP
derpPort: 443 # advertised to clients
stunListenAddr: 127.0.0.1:3478
policy:
create: true
hujson: |-
{
"groups": {},
"hosts": {},
"acls": [
{ "action": "accept", "src": ["*"], "dst": ["*:*"] }
]
}
headplane:
enabled: false
Upgrading existing installs
- This chart does not set explicit
namespace:; set the namespace via--namespaceand keep it consistent. - Changing
ingress.hostortls.secretNamerequires DNS and cert-manager readiness. - If you switch from chart-created secrets to external secrets, set
existingSecretand remove the chart-managed secret.
Troubleshooting
- Pod fails with DERP errors
- Ensure
headscale.derp.enabled=trueandheadscale.derp.stunListenAddris non-empty. - If DERPMap is empty, set
headscale.derp.urlsto Tailscale default temporarily:https://controlplane.tailscale.com/derpmap/default.
- Ensure
- TLS warning in logs
- Expected when TLS terminates at Ingress but
serverUrlis https.
- Expected when TLS terminates at Ingress but
- ACL policy reloads
- Headscale reads
policy.path(HEADSCALE_POLICY_PATH) and will reload on change in recent versions; if not, restart the pod.
- Headscale reads
License
This chart contains configuration files from this repository and does not add a license header by default.
Deploy headscale with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has headscale on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartheadscale is pinned at v0.1.4-dev in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply