Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aed108a781 |
No files matched your search
@@ -1,105 +0,0 @@
|
|||||||
# Linode (Akamai Cloud) Managed PostgreSQL: networking, security, backups
|
|
||||||
|
|
||||||
Research for issue #49 (part of #44). Researched 2026-11-23 against Akamai TechDocs, the Akamai pricing page, and the `linode/terraform-provider-linode` repo (latest release v4.10.0, published 2026-11-19).
|
|
||||||
|
|
||||||
## Which generation this covers
|
|
||||||
|
|
||||||
There are two Linode/Akamai Managed Database generations. The API reports which one you have in the `platform` field: `rdbms-legacy` or `rdbms-default` ([API: create PostgreSQL DB][api-create]).
|
|
||||||
|
|
||||||
- **Legacy** (`rdbms-legacy`): the original Linode DBaaS. Akamai is migrating these databases to the new system. Some legacy endpoints, such as the database backups endpoints, aren't supported in the new product and will be deprecated ([changelog 2024-11-14][cl-2024]).
|
|
||||||
- **Current** (`rdbms-default`): Akamai "reintroduced" the service on 2024-11-14, built with Aiven, in 20 core compute regions ([changelog 2024-11-14][cl-2024], [cluster overview][overview]).
|
|
||||||
|
|
||||||
**Everything below applies to the current (Aiven-based) generation only.** Older guides and blog posts that describe the legacy product (for example, ones listing PG 13 or a backups API) don't apply to it.
|
|
||||||
|
|
||||||
## Bottom line for hAPI
|
|
||||||
|
|
||||||
- **Private access is possible, through a VPC.** A database cluster can be attached to a VPC in the same region (`private_network.vpc_id` / `subnet_id`). Its hostname then resolves to a private IPv4 address in the VPC subnet, and public access is off unless `public_access = true` ([manage clusters][manage], [API: create][api-create]). Our self-managed Kubernetes nodes are plain Linode Compute instances, and "Linodes can join a VPC by specifying the VPC as a network interface" ([VPC][vpc]). So the nodes need a VPC interface in the same VPC and region as the database.
|
|
||||||
- **Caveat: VPC for Managed Databases launched as beta (2025-09-30), and I found no GA announcement.** The API changelog says use of `private_network` "is in beta" and "may cause disruptions in certain production environments" ([API changelog 2025-09-30][api-cl-vpc], [cloud changelog 2025-09-30][cl-vpc]). The current manage-clusters page doesn't label it beta, but no changelog entry declares it GA. Treat it as beta until you see a GA entry.
|
|
||||||
- **Without a VPC: public endpoint plus an IP allowlist.** Each cluster has an ACL, and "by default, all connections both public and private are blocked unless they appear on this list" ([manage clusters][manage]). The ACL still applies when a VPC is attached, so add the VPC subnet CIDR to `allow_list` (inference from that quote, not stated outright).
|
|
||||||
- **The LKE auto-allowlist doesn't help us.** Akamai rewrites each database's ACL every 10 minutes with the IPs of all **LKE** nodes in the account ([manage clusters][manage]). hAPI runs self-managed Kubernetes on Compute, not LKE, so node IPs have to be managed ourselves (for example with Terraform `linode_database_access_controls`). Also note that if LKE is ever used in the same account, every LKE node is allowlisted on every database automatically. Opting out requires a support ticket.
|
|
||||||
- **TLS is mandatory.** `ssl_connection` is "currently required to be `true`". A CA certificate is downloadable from Cloud Manager or available as the Terraform `ca_cert` attribute, so clients can use `sslmode=verify-full` ([API: create][api-create], [PostgreSQL doc][pg], [TF resource][tf]).
|
|
||||||
- **Backups:** daily backups, kept 14 days, with point-in-time restore inside that window. Restores always create a new (forked) cluster ([overview][overview], [manage clusters][manage]).
|
|
||||||
- **Cheapest option:** Shared 1 GB at $16/mo for one node or $37/mo for three nodes (HA). That plan has 9 GB of usable storage ([pricing][pricing]).
|
|
||||||
|
|
||||||
## Versions
|
|
||||||
|
|
||||||
- PostgreSQL **15, 16, 17, 18** are supported ([engines and plans][engines]). Engine IDs look like `postgresql/16`; the live list comes from the List engines API ([API: create][api-create]).
|
|
||||||
- Major-version upgrades run in place, start immediately when you click Upgrade, and can't be reverted. A failed compatibility check rolls back. Discontinued versions are upgraded automatically during the maintenance window ([manage clusters][manage]). I found no published version EOL schedule.
|
|
||||||
|
|
||||||
## Plans and HA
|
|
||||||
|
|
||||||
- Plan families: Shared CPU and Dedicated CPU; premium Linode types are also accepted ([engines and plans][engines], [API changelog 2025-09-30][api-cl-vpc]). Ranges: Dedicated 1-3 nodes, 4-512 GB RAM, 80-7200 GB storage. Shared 1 or 3 nodes, 1-192 GB RAM, 25-7200 GB storage ([overview][overview]).
|
|
||||||
- `cluster_size`: `1`, `2`, or `3`. `3` means one primary and two standbys. `2` is dedicated-only ([API: create][api-create]). Three-node clusters give "data redundancy and automatic failover" ([overview][overview]).
|
|
||||||
- HA tuning through `engine_config`: `pglookout.max_failover_replication_time_lag` (TF default 60 s) and `synchronous_replication` (`quorum` or `off`, three-node only) ([API: create][api-create], [TF resource][tf]).
|
|
||||||
- Single-node clusters have downtime during maintenance and resizes ([manage clusters][manage]).
|
|
||||||
|
|
||||||
## Networking details
|
|
||||||
|
|
||||||
- The VPC must be in the same region as the cluster. You can assign, change, or unassign a VPC after creation, but "any change of the networking settings causes a temporary downtime" ([manage clusters][manage]).
|
|
||||||
- With `public_access = true`, a second hostname is published. Swap the `private-` prefix for `public-` to get it ([manage clusters][manage]). The API `endpoints` array (added 2026-03-31) lists each address with its role and `public_access` ([API changelog 2026-03][api-cl-2026]).
|
|
||||||
- The VPC subnet doesn't automatically block outbound connections outside the subnet. Akamai recommends Cloud Firewall rules on the VPC Linodes, including blocking inbound traffic from the cluster's VPC range ([manage clusters][manage], search summary of [API: update][api-update]).
|
|
||||||
- VPC traffic "is isolated from other cloud tenants, [but] it is not encrypted", and VPC interfaces have no IPv6 ([VPC][vpc]). TLS (mandatory) covers this.
|
|
||||||
- The docs say "the connection to a database cluster over a private IP address is not supported" and recommend public IPv6 instead ([manage clusters][manage]). This sits in the ACL section, so I read it as referring to legacy Linode private IPv4 (`192.168.128.0/17`, shared by all Linodes in a region, [VPC][vpc]) rather than VPC addresses. The page doesn't define the term, though. **Verify before relying on either reading.**
|
|
||||||
- Cost: inbound transfer is free. Public IPv4 from Linodes costs egress; IPv6 (AAAA) from same-region Linodes avoids transfer charges ([overview][overview], [manage clusters][manage]). VPCs themselves cost nothing extra. Egress overage is $0.005/GB ([pricing][pricing]).
|
|
||||||
- Known issue: some PostgreSQL clients that prefer IPv6 can hang for about 3 minutes when only an IPv4 ACL entry exists ([manage clusters][manage]).
|
|
||||||
- VPCs are single-region, can't be peered, and are no longer supported in distributed regions as of 2026-04-22 ([VPC][vpc]).
|
|
||||||
|
|
||||||
## Users, roles, extensions, pooling
|
|
||||||
|
|
||||||
- The admin user is `akmadmin`. **Superuser isn't available.** Akamai says to use `akmadmin`/`defaultdb` for administration only and to create separate users and databases for applications ([PostgreSQL doc][pg]). There's no API or Terraform resource for database users or roles, so per-app roles have to be created in SQL (for example, a migration or bootstrap job running as `akmadmin`).
|
|
||||||
- The root password can be reset (a new random one is generated), but the root user can't be removed ([manage clusters][manage], [overview][overview]). Terraform exposes `root_username` and `root_password` as attributes, so the password ends up in Terraform state.
|
|
||||||
- `engine_config_pg_password_encryption` defaults to **`md5`** according to the Terraform docs. Set `scram-sha-256` explicitly ([TF resource][tf]).
|
|
||||||
- Extensions: Akamai links to Aiven's extension list instead of publishing its own ([PostgreSQL doc][pg]). `pg_stat_monitor` (toggle restarts the cluster), `pg_stat_statements` and `pg_partman` settings are exposed through `engine_config` ([TF resource][tf]).
|
|
||||||
- PgBouncer connection pools (API-managed) were added on 2026-03-31 ([API changelog 2026-03][api-cl-2026]).
|
|
||||||
- Encryption at rest: Terraform exports an `encrypted` attribute ([TF resource][tf]). I didn't find a first-party Akamai statement on at-rest encryption; the overview page only links to Aiven's encryption docs ([overview][overview]).
|
|
||||||
- There's no OS access, config files can't be edited, and replicas can't be hosted outside the service ([overview][overview]).
|
|
||||||
|
|
||||||
## Backups and restore
|
|
||||||
|
|
||||||
- Daily backups, retained 14 days, no extra cost. Point-in-time recovery for any time in that window ([overview][overview]).
|
|
||||||
- To restore, create a new database with `fork.source` and an optional `fork.restore_time` (must be newer than `oldest_restore_time`). Without `restore_time` you get the newest full backup plus incremental. A restore always makes a **new cluster**; delete the original to stop paying for both ([API: create][api-create], [manage clusters][manage]).
|
|
||||||
- A deleted database's backups are kept for 180 days, and a suspended cluster can be resumed within 180 days ([manage clusters][manage]).
|
|
||||||
- There's no off-platform or exportable backup feature and no configurable retention. For personal finance data, we'd need our own `pg_dump` to separate storage (such as Object Storage) to survive account-level loss or retention longer than 14 days. That's my inference, not an Akamai recommendation.
|
|
||||||
|
|
||||||
## Maintenance
|
|
||||||
|
|
||||||
- Window defaults to Sunday 20:00 UTC, weekly. `duration` "can only be `4`" hours and `frequency` "can only be `weekly`" via API/TF; day and hour (UTC) are configurable ([manage clusters][manage], [API: create][api-create]). The manage page says the default lasts 3 hours, which conflicts with the API's fixed 4.
|
|
||||||
- Pending updates appear in `pending_updates`, with a deadline, and can be applied manually ([TF resource][tf], [manage clusters][manage]).
|
|
||||||
|
|
||||||
## Pricing (PostgreSQL = MySQL, monthly, USD)
|
|
||||||
|
|
||||||
| Plan | vCPU / RAM / usable storage | 1 node | 2 nodes | 3 nodes |
|
|
||||||
|---|---|---|---|---|
|
|
||||||
| Shared 1 GB | 1 / 1 GB / 9 GB | $16 | n/a | $37 |
|
|
||||||
| Shared 2 GB | 1 / 2 GB / 30 GB | $32 | n/a | $74 |
|
|
||||||
| Shared 4 GB | 2 / 4 GB / 58 GB | $63 | n/a | $147 |
|
|
||||||
| G7 Dedicated 4 GB | 2 / 4 GB / 58 GB | $81.60 | $171.60 | $246 |
|
|
||||||
|
|
||||||
Source: [pricing][pricing]. The pricing page marks shared plans as "legacy hardware". Akamai also advertises a $100 trial credit.
|
|
||||||
|
|
||||||
## Terraform support
|
|
||||||
|
|
||||||
- Use `linode_database_postgresql_v2`. The v1 `linode_database_postgresql` doc no longer exists in the provider repo (404 on `main`). Remaining database resources: `database_postgresql_v2`, `database_mysql_v2`, `database_access_controls` ([provider repo docs][tf-dir]).
|
|
||||||
- `linode_database_postgresql_v2` supports `engine_id`, `region`, `type`, `cluster_size`, `allow_list`, `private_network { vpc_id, subnet_id, public_access }` (in Terraform, `subnet_id` is **required** when `private_network` is set), `fork_source` / `fork_restore_time`, `updates`, and many `engine_config_*` fields. It exports `ca_cert`, `host_primary`, `host_secondary` (private host), `root_username`, `root_password`, `port`, and `encrypted`. Provisioning "can take up to half an hour" ([TF resource][tf]).
|
|
||||||
- I didn't find PgBouncer pool resources in the provider docs listing.
|
|
||||||
|
|
||||||
## Open questions
|
|
||||||
|
|
||||||
- Is VPC for Managed Databases GA yet? No changelog entry says so, as of 2026-11-23.
|
|
||||||
- What exactly does "connection over a private IP address is not supported" mean? See the networking section above.
|
|
||||||
- Is at-rest encryption on by default? There's no first-party Akamai statement.
|
|
||||||
|
|
||||||
[overview]: https://techdocs.akamai.com/cloud-computing/docs/aiven-database-clusters
|
|
||||||
[manage]: https://techdocs.akamai.com/cloud-computing/docs/aiven-manage-database
|
|
||||||
[engines]: https://techdocs.akamai.com/cloud-computing/docs/database-engines-plans
|
|
||||||
[pg]: https://techdocs.akamai.com/cloud-computing/docs/aiven-postgresql
|
|
||||||
[vpc]: https://techdocs.akamai.com/cloud-computing/docs/vpc
|
|
||||||
[api-create]: https://techdocs.akamai.com/linode-api/reference/post-databases-postgre-sql-instances
|
|
||||||
[api-update]: https://techdocs.akamai.com/linode-api/reference/put-databases-postgre-sql-instance
|
|
||||||
[api-cl-vpc]: https://techdocs.akamai.com/linode-api/changelog/sep-30-2025-managed-databases-vpc-support
|
|
||||||
[cl-vpc]: https://techdocs.akamai.com/cloud-computing/changelog/vpc-for-dbaas
|
|
||||||
[api-cl-2026]: https://techdocs.akamai.com/linode-api/changelog/mar-2026-managed-databases-updates
|
|
||||||
[cl-2024]: https://techdocs.akamai.com/cloud-computing/changelog/nov-14-2024-database
|
|
||||||
[pricing]: https://www.akamai.com/cloud/pricing/databases
|
|
||||||
[tf]: https://github.com/linode/terraform-provider-linode/blob/main/docs/resources/database_postgresql_v2.md
|
|
||||||
[tf-dir]: https://github.com/linode/terraform-provider-linode/tree/main/docs/resources
|
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
# Private connectivity between the home network and a Linode cluster
|
||||||
|
|
||||||
|
Research for Gitea issue #46 (part of map #44). Researched 2026-11-23.
|
||||||
|
|
||||||
|
## Question
|
||||||
|
|
||||||
|
What are the options for a private, authenticated link between the Owner's home
|
||||||
|
network (Home Assistant, LAN Bots) and a self-managed Kubernetes cluster on
|
||||||
|
Linode? Compare Tailscale (incl. the Kubernetes operator / subnet routers),
|
||||||
|
Headscale, plain WireGuard site-to-site, and Linode VPC features: setup,
|
||||||
|
security model, failure modes, how in-cluster Services are exposed over the
|
||||||
|
link, and cost.
|
||||||
|
|
||||||
|
## TL;DR
|
||||||
|
|
||||||
|
- **Linode VPC can't do this.** It is a single-data-center private network
|
||||||
|
with no VPN/on-prem attachment, no peering, and **no encryption**. Akamai
|
||||||
|
has no managed site-to-site VPN product. VPC only matters for
|
||||||
|
traffic inside the cluster. [VPC][akamai-vpc]
|
||||||
|
- **Tailscale + the Kubernetes operator is the lowest-effort fit.** You can
|
||||||
|
expose a Bot-facing Service to the tailnet with one annotation. Home Assistant
|
||||||
|
joins via the community add-on, which can also act as a subnet router for
|
||||||
|
other LAN Bots. Grants are deny-by-default, so you can limit LAN Bots
|
||||||
|
to the Bot-facing Service only. The free Personal plan covers this load.
|
||||||
|
- **Surprise: Tailnet Lock does not work with the operator.** Tailnet Lock is
|
||||||
|
Tailscale's defense against a compromised coordination server, and the
|
||||||
|
operator can't sign the proxy nodes it creates. The feature request is
|
||||||
|
still open. So with the operator you have to trust Tailscale's control plane.
|
||||||
|
[#13273][ts-13273]
|
||||||
|
- **Headscale removes that third-party trust, but it isn't ready yet for the
|
||||||
|
operator path.** Operator compatibility (OAuth clients on a v2 API) was
|
||||||
|
merged in June 2026 for v0.30.0, but the latest release is still v0.29.7. You'd
|
||||||
|
also have to host and secure the control server yourself.
|
||||||
|
[#3334][hs-3334] [releases][hs-releases]
|
||||||
|
- **Plain WireGuard has the smallest and most auditable surface**: a silent
|
||||||
|
UDP port and static keys. But you do all key management, routing into the
|
||||||
|
cluster, and HA by hand.
|
||||||
|
|
||||||
|
**Tentative recommendation** (a decision for the Owner, not made here):
|
||||||
|
Tailscale with the operator, an L3 `tailscale` Service for the Bot-facing
|
||||||
|
listener, tagged nodes, and a tight grants policy with `tests`. Keep the
|
||||||
|
Bot-facing listener off the public Ingress entirely. If the Owner wants
|
||||||
|
no third-party control plane, choose plain WireGuard (a single gateway now)
|
||||||
|
or wait for Headscale v0.30.0.
|
||||||
|
|
||||||
|
## Options compared
|
||||||
|
|
||||||
|
| | Tailscale (SaaS) + operator | Headscale + Tailscale clients | Plain WireGuard | Linode VPC |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| Reaches home LAN? | Yes | Yes | Yes | **No** |
|
||||||
|
| Encryption | WireGuard, keys never leave devices | Same | WireGuard | **None** (isolation only) |
|
||||||
|
| Control plane | Tailscale-hosted | Self-hosted | None (static config) | n/a |
|
||||||
|
| Inbound ports on cluster | None required (DERP relay fallback) | Control server must be reachable, and its DERP if embedded | One UDP port | n/a |
|
||||||
|
| Expose k8s Service | Annotation / `loadBalancerClass: tailscale` / Ingress class | Same operator, **only once v0.30.0 ships** | DIY routing | n/a |
|
||||||
|
| Access control | Grants/ACLs, deny-by-default, policy tests | ACLs/Grants supported | Cryptokey routing + your firewall rules | Cloud Firewall |
|
||||||
|
| Cost | $0 (Personal: 6 users, 50 tagged resources) | $0 + hosting a server | $0 | $0 |
|
||||||
|
|
||||||
|
## Linode VPC and Cloud Firewall
|
||||||
|
|
||||||
|
- VPCs connect Linodes **within one data center**. They can't span data
|
||||||
|
centers, and VPC peering isn't supported. [VPC][akamai-vpc]
|
||||||
|
- "Traffic is isolated but not encrypted." There's no IPv6 on VPC interfaces.
|
||||||
|
VPCs have no extra charge. [VPC][akamai-vpc]
|
||||||
|
- The docs mention no VPN or on-prem attachment. I found no official Akamai
|
||||||
|
site-to-site VPN product. The only guidance for on-prem links is community
|
||||||
|
posts about running your own IPsec/strongSwan gateway on a Linode
|
||||||
|
([community 21930][linode-c-21930]; low trust, used only to show that
|
||||||
|
nothing first-party exists).
|
||||||
|
- Cloud Firewall is stateful and free. It covers Linodes and NodeBalancers and
|
||||||
|
allows max 25 rules per firewall. Rules apply to public and private traffic.
|
||||||
|
For NodeBalancers, rules cover only the public IP, so backends need their own
|
||||||
|
firewall. [Cloud Firewall][akamai-fw]
|
||||||
|
|
||||||
|
**Verdict:** VPC is useful for node-to-node traffic inside the cluster. It
|
||||||
|
plays no part in the home link. Cloud Firewall is complementary: with WireGuard,
|
||||||
|
it limits the UDP port to the home public IP (if that IP is stable).
|
||||||
|
|
||||||
|
## Tailscale (SaaS) with the Kubernetes operator
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
- The operator is available on all plans. It covers ingress (tailnet → cluster
|
||||||
|
workloads), egress (cluster → tailnet devices), API-server proxy, and
|
||||||
|
subnet routers/exit nodes via a `Connector` resource.
|
||||||
|
[operator][ts-operator]
|
||||||
|
- Prerequisites: in the policy file, set `tagOwners` with
|
||||||
|
`"tag:k8s-operator": ["autogroup:admin"]` and
|
||||||
|
`"tag:k8s": ["tag:k8s-operator"]`. Create an OAuth client with read/write on
|
||||||
|
Services, Devices Core, and Auth Keys, tagged `tag:k8s-operator`. The operator
|
||||||
|
stores the credentials in the `operator-oauth` secret in the `tailscale`
|
||||||
|
namespace. [quickstart][ts-quickstart]
|
||||||
|
- If you want non-default proxy tags (e.g. `tag:hapi-bot`), `tag:k8s-operator`
|
||||||
|
must own them, and the OAuth client must be allowed to use them. There's
|
||||||
|
a known startup failure with multiple `defaultTags`
|
||||||
|
([issue #15732][ts-15732]).
|
||||||
|
|
||||||
|
### Exposing in-cluster Services over the link
|
||||||
|
|
||||||
|
From [cluster ingress][ts-ingress]:
|
||||||
|
|
||||||
|
- **L3 (TCP/UDP):** annotate the Service with `tailscale.com/expose: "true"`, *or*
|
||||||
|
set `type: LoadBalancer` + `loadBalancerClass: tailscale`. A proxy Pod DNATs
|
||||||
|
its tailnet IP to the Service's ClusterIP.
|
||||||
|
- **L7 (HTTP/S):** use `Ingress` with `ingressClassName: tailscale`. You get a
|
||||||
|
MagicDNS name and a Let's Encrypt cert through Tailscale Serve.
|
||||||
|
- These are **not public** by default. Public needs Funnel, which you should
|
||||||
|
avoid for the Bot side.
|
||||||
|
- HA: a `ProxyGroup` (`tailscale.com/proxy-group` annotation) runs multiple
|
||||||
|
active proxies. Tailscale recommends it for production.
|
||||||
|
|
||||||
|
So a Bot-facing hAPI listener can be its own Service, reachable *only* via
|
||||||
|
the tailnet. Persons hit the public Ingress, which never routes to it.
|
||||||
|
|
||||||
|
### Home side
|
||||||
|
|
||||||
|
- **Home Assistant:** the community add-on supports `advertise_routes`
|
||||||
|
(subnet router), `accept_routes`, `advertise_tags`, `login_server` (custom
|
||||||
|
control server, e.g. Headscale), and `userspace_networking`.
|
||||||
|
[addon-tailscale docs][ha-addon]
|
||||||
|
- **Other LAN Bots** that can't run Tailscale go through a subnet router (the
|
||||||
|
HA add-on, or another always-on box). Devices behind a subnet router don't
|
||||||
|
count toward the device limit. SNAT is on by default, so cluster-side traffic
|
||||||
|
appears to come from the router, which loses per-Bot source IPs unless you set
|
||||||
|
`--snat-subnet-routes=false` (Linux only, needs return routes for
|
||||||
|
`100.64.0.0/10`). Route approval is separate from access: you need grants
|
||||||
|
too. [subnet routers][ts-subnets]
|
||||||
|
- Tailscale prefers installing the client directly on each device over
|
||||||
|
subnet routing. [subnet routers][ts-subnets]
|
||||||
|
|
||||||
|
### Security model
|
||||||
|
|
||||||
|
- Data plane: WireGuard. Private keys never leave the device. DERP relays
|
||||||
|
forward already-encrypted traffic they can't decrypt. Connections are usually
|
||||||
|
direct, with peer relays and then DERP as fallback. [DERP][ts-derp]
|
||||||
|
- Policy: deny-by-default grants (`src`/`dst`/`ip`). A `tests` section
|
||||||
|
rejects policy updates that break assertions. Example intent: `src:
|
||||||
|
["tag:home-bot"]`, `dst: ["tag:hapi-bot:443"]`. [policy syntax][ts-policy]
|
||||||
|
- **Trust in the control plane:** Tailscale's coordination server distributes
|
||||||
|
node keys, so a compromised control plane could inject nodes. Tailnet Lock
|
||||||
|
closes that gap: nodes must be signed by trusted keys held on your devices.
|
||||||
|
It's available on Personal. [Tailnet Lock][ts-lock]
|
||||||
|
- **But the operator can't add its proxies to a locked tailnet** without manual
|
||||||
|
signing of each proxy node key. Issue #13273 and PR #14404 are still open as
|
||||||
|
of this research. [#13273][ts-13273] This trade-off is the main thing to
|
||||||
|
weigh: operator convenience vs. control-plane-compromise resistance. One
|
||||||
|
workaround: skip the operator and run a single `tailscaled` gateway
|
||||||
|
(e.g. a Deployment with persisted state, or a node-level install) whose key
|
||||||
|
is signed once, routing to the Bot-facing Service.
|
||||||
|
|
||||||
|
### Failure modes
|
||||||
|
|
||||||
|
- Tailscale control plane outage: existing connections generally keep working,
|
||||||
|
but new nodes/key changes stall. (General property of the design. I didn't
|
||||||
|
find a precise first-party statement for this, so check before relying on it.)
|
||||||
|
- Proxy Pod restart blips the link unless you use `ProxyGroup` HA. [ingress][ts-ingress]
|
||||||
|
- A subnet router going offline drops its routes, and there's no fallback to a
|
||||||
|
less specific route. Run two routers for HA, without `--accept-routes` on
|
||||||
|
them. [subnet routers][ts-subnets]
|
||||||
|
- Let's Encrypt rate limits can bite L7 Ingress on frequent redeploys.
|
||||||
|
[ingress][ts-ingress]
|
||||||
|
|
||||||
|
### Cost
|
||||||
|
|
||||||
|
Personal plan: $0, non-commercial, up to 6 users, unlimited user devices,
|
||||||
|
**50 tagged resources** (then $1/mo each), 3 ACL groups. Operator proxies and
|
||||||
|
tagged gateways count as tagged resources. That's ample here. [pricing][ts-pricing]
|
||||||
|
|
||||||
|
## Headscale
|
||||||
|
|
||||||
|
- An open-source, self-hosted implementation of the Tailscale control server.
|
||||||
|
Its scope is deliberately narrow: **a single tailnet**, for self-hosters and
|
||||||
|
hobbyists. [headscale][hs-home]
|
||||||
|
- Supported: ACLs, Grants, Tailscale SSH, auto approvers, subnet routers, exit
|
||||||
|
nodes, tags, OIDC (but OIDC groups can't be used in ACLs), embedded DERP, and
|
||||||
|
Taildrop. Funnel/Serve and Tailnet Lock aren't listed as supported.
|
||||||
|
[features][hs-features]
|
||||||
|
- **Operator compatibility:** the operator chart has a `loginServer` value for a
|
||||||
|
non-Tailscale control plane ([values.yaml][ts-values]). Headscale PR #3334
|
||||||
|
("add OAuth clients and scopes to the v2 API") was merged on 2026-06-26 and
|
||||||
|
closed issue #1202 ("OAuth Provider + Tailscale Kubernetes operator
|
||||||
|
compatibility") under milestone v0.30.0. [#3334][hs-3334] [#1202][hs-1202]
|
||||||
|
**The latest release is v0.29.7, so it hasn't shipped yet.** [releases][hs-releases]
|
||||||
|
- The HA add-on supports `login_server`, so the home side works today.
|
||||||
|
[ha-addon][ha-addon]
|
||||||
|
- **Security trade-off:** you remove Tailscale Inc. from the trust base, but the
|
||||||
|
control server becomes your crown jewel. It must be reachable by home and
|
||||||
|
cluster nodes, so it's internet-exposed somewhere. Hosting it *inside* the
|
||||||
|
cluster it protects creates a bootstrap/circular dependency. You also own
|
||||||
|
its patching, backups, and DERP.
|
||||||
|
- **Cost:** software is free. Hosting is a small Linode or a cluster
|
||||||
|
workload, plus operations time.
|
||||||
|
|
||||||
|
## Plain WireGuard site-to-site
|
||||||
|
|
||||||
|
### Security model
|
||||||
|
|
||||||
|
- Cryptokey routing: each peer is a public key with a list of allowed IPs. Those
|
||||||
|
act as the routing table for outbound traffic and the ACL for inbound, so
|
||||||
|
firewall rules on source IP + interface are trustworthy. It uses Noise,
|
||||||
|
Curve25519, ChaCha20-Poly1305, BLAKE2, and HKDF, and the codebase is
|
||||||
|
small enough to audit. [wireguard.com][wg-home]
|
||||||
|
- The server "does not even *respond at all*" to unauthenticated packets. It's
|
||||||
|
silent to scanners, with a cookie mechanism under load. Handshakes occur
|
||||||
|
every few minutes for rotating session keys. [protocol][wg-protocol]
|
||||||
|
- Key distribution is out of scope: you exchange public keys out of band,
|
||||||
|
like SSH keys. [wireguard.com][wg-home]
|
||||||
|
|
||||||
|
### Setup and exposing Services
|
||||||
|
|
||||||
|
- Home side: a WireGuard peer on an always-on LAN box (or router). It
|
||||||
|
initiates toward the cluster's public UDP endpoint, with
|
||||||
|
`PersistentKeepalive = 25` to hold the NAT mapping (off by default).
|
||||||
|
[quickstart][wg-quick] The cluster doesn't need to know the home IP, because
|
||||||
|
WireGuard roams to the last authenticated endpoint. [wireguard.com][wg-home]
|
||||||
|
- Cluster side: you do all of it yourself. Options:
|
||||||
|
- A WireGuard interface on one node (host-level), routing the tunnel subnet
|
||||||
|
to the Bot-facing Service's ClusterIP or a dedicated internal IP.
|
||||||
|
- A gateway Pod with `hostNetwork` or a UDP NodePort/LoadBalancer.
|
||||||
|
Either way you handle iptables/nftables, return routes, and which node holds
|
||||||
|
the endpoint.
|
||||||
|
- Lock the UDP port down with Cloud Firewall (to the home public IP if it's
|
||||||
|
stable). [Cloud Firewall][akamai-fw]
|
||||||
|
|
||||||
|
### Failure modes
|
||||||
|
|
||||||
|
- A single gateway node is a single point of failure, and HA needs your own
|
||||||
|
failover (e.g. floating IP + keepalived). There's no built-in relay, so a home
|
||||||
|
network with broken outbound UDP just fails. Losing a key means editing
|
||||||
|
configs by hand on both sides.
|
||||||
|
|
||||||
|
### Cost
|
||||||
|
|
||||||
|
$0 (in-kernel software). You pay only in operator time.
|
||||||
|
|
||||||
|
## How this fits hAPI
|
||||||
|
|
||||||
|
- **Separation of Principals by network:** Persons → public Ingress. Bots →
|
||||||
|
a distinct Bot-facing Service exposed only on the private link. Defense in
|
||||||
|
depth: hAPI should still authenticate Bots at the application layer (the link
|
||||||
|
is a network control, not Principal authentication).
|
||||||
|
- With Tailscale/Headscale, tags give a stable identity per home device or
|
||||||
|
subnet router. With SNAT on, hAPI sees only the router's address, so per-Bot
|
||||||
|
identity must come from app-level credentials anyway.
|
||||||
|
|
||||||
|
## Open questions for the Owner
|
||||||
|
|
||||||
|
1. Is trusting Tailscale's hosted control plane acceptable, given Tailnet
|
||||||
|
Lock is unavailable with the operator? If not: plain WireGuard now, or
|
||||||
|
Headscale once v0.30.0 ships.
|
||||||
|
2. Can each LAN Bot run a Tailscale client, or do most need a subnet router
|
||||||
|
(which loses per-device source identity unless SNAT is disabled)?
|
||||||
|
3. Is the home public IP stable (relevant to firewalling a WireGuard port)?
|
||||||
|
|
||||||
|
## Sources
|
||||||
|
|
||||||
|
- [akamai-vpc]: https://techdocs.akamai.com/cloud-computing/docs/vpc
|
||||||
|
- [akamai-fw]: https://techdocs.akamai.com/cloud-computing/docs/cloud-firewall
|
||||||
|
- [linode-c-21930]: https://www.linode.com/community/questions/21930/site-to-site-vpn (community, low trust)
|
||||||
|
- [ts-operator]: https://tailscale.com/kb/1236/kubernetes-operator
|
||||||
|
- [ts-quickstart]: https://tailscale.com/docs/kubernetes-operator/quickstart
|
||||||
|
- [ts-ingress]: https://tailscale.com/kb/1439/kubernetes-operator-cluster-ingress
|
||||||
|
- [ts-15732]: https://github.com/tailscale/tailscale/issues/15732
|
||||||
|
- [ts-values]: https://github.com/tailscale/tailscale/blob/main/cmd/k8s-operator/deploy/chart/values.yaml
|
||||||
|
- [ts-subnets]: https://tailscale.com/kb/1019/subnets
|
||||||
|
- [ts-derp]: https://tailscale.com/kb/1232/derp-servers
|
||||||
|
- [ts-policy]: https://tailscale.com/kb/1337/policy-syntax
|
||||||
|
- [ts-lock]: https://tailscale.com/kb/1226/tailnet-lock
|
||||||
|
- [ts-13273]: https://github.com/tailscale/tailscale/issues/13273
|
||||||
|
- [ts-pricing]: https://tailscale.com/pricing
|
||||||
|
- [ha-addon]: https://github.com/hassio-addons/addon-tailscale/blob/main/tailscale/DOCS.md
|
||||||
|
- [hs-home]: https://headscale.net/stable/
|
||||||
|
- [hs-features]: https://headscale.net/stable/about/features/
|
||||||
|
- [hs-3334]: https://github.com/juanfont/headscale/pull/3334
|
||||||
|
- [hs-1202]: https://github.com/juanfont/headscale/issues/1202
|
||||||
|
- [hs-releases]: https://github.com/juanfont/headscale/releases
|
||||||
|
- [wg-home]: https://www.wireguard.com/
|
||||||
|
- [wg-protocol]: https://www.wireguard.com/protocol/
|
||||||
|
- [wg-quick]: https://www.wireguard.com/quickstart/
|
||||||
|
|
||||||
|
[akamai-vpc]: https://techdocs.akamai.com/cloud-computing/docs/vpc
|
||||||
|
[akamai-fw]: https://techdocs.akamai.com/cloud-computing/docs/cloud-firewall
|
||||||
|
[linode-c-21930]: https://www.linode.com/community/questions/21930/site-to-site-vpn
|
||||||
|
[ts-operator]: https://tailscale.com/kb/1236/kubernetes-operator
|
||||||
|
[ts-quickstart]: https://tailscale.com/docs/kubernetes-operator/quickstart
|
||||||
|
[ts-ingress]: https://tailscale.com/kb/1439/kubernetes-operator-cluster-ingress
|
||||||
|
[ts-15732]: https://github.com/tailscale/tailscale/issues/15732
|
||||||
|
[ts-values]: https://github.com/tailscale/tailscale/blob/main/cmd/k8s-operator/deploy/chart/values.yaml
|
||||||
|
[ts-subnets]: https://tailscale.com/kb/1019/subnets
|
||||||
|
[ts-derp]: https://tailscale.com/kb/1232/derp-servers
|
||||||
|
[ts-policy]: https://tailscale.com/kb/1337/policy-syntax
|
||||||
|
[ts-lock]: https://tailscale.com/kb/1226/tailnet-lock
|
||||||
|
[ts-13273]: https://github.com/tailscale/tailscale/issues/13273
|
||||||
|
[ts-pricing]: https://tailscale.com/pricing
|
||||||
|
[ha-addon]: https://github.com/hassio-addons/addon-tailscale/blob/main/tailscale/DOCS.md
|
||||||
|
[hs-home]: https://headscale.net/stable/
|
||||||
|
[hs-features]: https://headscale.net/stable/about/features/
|
||||||
|
[hs-3334]: https://github.com/juanfont/headscale/pull/3334
|
||||||
|
[hs-1202]: https://github.com/juanfont/headscale/issues/1202
|
||||||
|
[hs-releases]: https://github.com/juanfont/headscale/releases
|
||||||
|
[wg-home]: https://www.wireguard.com/
|
||||||
|
[wg-protocol]: https://www.wireguard.com/protocol/
|
||||||
|
[wg-quick]: https://www.wireguard.com/quickstart/
|
||||||
Reference in new issue
Block a user