Infrastructure cost optimisation plan
As of 2026-11-19. This is a working plan: the figures go stale, so check the date.
How to read this page: Section 1 is the one-screen answer. Section 2 is the plan. Section 3 describes our infrastructure today. Section 4 explains why we chose this plan and why the cost cannot shrink. Section 5 explains how to apply it. Section 6 lists open questions, and the appendices hold commands and sources.
All prices are approximate and come from the DO console and DO's public pricing pages. Confirm them in the resize dialog and on the invoice before acting.
[[TOC]]
1. Summary¶
We will stay on DigitalOcean Droplets, keep GitLab there for ArgoCD high availability, add the missing DO Load Balancer, and buy a UPS for the home servers. The DO bill cannot shrink without giving up RAM, disk or GitLab, so the plan is about reliability, not savings.
| Question | Answer |
|---|---|
| What do we pay today? | $186/month for 3 Droplets |
| What will we pay? | About $198/month (adds a load balancer) |
| Can the cost go down? | Not without giving up RAM, disk or GitLab |
| What else costs money? | UPS, one-off, 7,000–12,000 THB |
| Home electricity? | Free at the site |
Key facts behind the answer:
- RAM is the limit, not CPU. CPU is 23–33% used, but RAM is 60%, 81% and 78%. DO bundles CPU, RAM and disk in each plan, so cutting CPU alone saves nothing.
- The next plan down needs GitLab to leave. GitLab is about 5 GiB of the 12.2 GiB used on the 16 GB Droplet. GitLab must stay on DO, so the Droplets keep their sizes.
- Other providers do not help much. Vultr and Linode cost about the same as DO. Hetzner raised prices in 2026. Only budget hosts such as Contabo are far cheaper, with performance and HA trade-offs.
- Where a saving might still hide: the DO invoice. The account Owner should check it for old snapshots, unused volumes, Reserved IPs or another load balancer in the PlayTelly project.
The biggest risks today:
- The entry point is a single Droplet IP, because there is no load balancer.
- A GitLab restore from the nightly backup has never been tested.
- The home switch and router restarted together on 2026-11-11, and there is no UPS.
- The home cluster cannot absorb the loss of a NUC, because RAM is 73–77% used on every node.
- The mac-mini runs k3s v1.35 while the control plane runs v1.34, which Kubernetes does not support.
2. The plan¶
| # | What we will do | Cost effect |
|---|---|---|
| 1 | Stay on the 3 DO Droplets | $186/month today |
| 2 | Keep GitLab on DO | No change |
| 3 | Keep Droplet sizes and disks as they are | $0 |
| 4 | Add a DO Load Balancer | About +$12/month |
| 5 | Prove backups, then patch node by node | $0 (Spaces about $5/month, optional) |
| 6 | Mirror the repos ArgoCD reads | $0 |
| 7 | Buy a 1500 VA UPS with NUT | 7,000–12,000 THB, one-off |
| 8 | Fix home items: router firmware, k3s versions | $0 |
Details for each step:
- Stay on the 3 DO Droplets. The 3-node k3s cluster stays as it is. No DOKS and no provider move.
- Keep GitLab on DO. ArgoCD reads its repositories from GitLab, so GitLab is part of the HA path.
- Keep the Droplet sizes and disks as they are. See 4.1 for why. Trim idle parts on the control plane (unused ArgoCD parts) to lower its 81% RAM use.
- Add a DO Load Balancer in front of the three Droplets. This is the missing piece of the HA design. Setup details are in 5.2.
- Fix safety first. Keep the existing nightly GitLab backup to mac-mini and prove a restore. Back up what it does not cover (Longhorn volumes, other secrets). Take Droplet snapshots before changes, and patch one node at a time.
- Protect GitLab in place. Push-mirror the repositories ArgoCD reads, keep the existing nightly backup, and prove a restore at home.
- Buy a UPS (about 1500 VA, pure sine) for the home servers (nuc-a, nuc-b, castis-desktop, mac-mini), the switch, the MikroTik and the modem, with NUT for a clean shutdown. Electricity at home is free. Details are in 5.3.
- Fix home items. Update the MikroTik firmware (RouterOS 6.47.8 is from November 2020) and align the k3s versions (upgrade the three control-plane nodes first).
What we will not do now: move to managed Kubernetes (DOKS), move GitLab to a home node, move everything home, or move to a cheaper provider. These are explained in 4.2 and can be reviewed later with the real invoice.
2.1 Current vs future plan¶
| Area | Today | After the plan |
|---|---|---|
| Public entry | One Droplet IP in DNS | DO Load Balancer over 3 Droplets |
| GitLab | 1 pod, nightly backup | Same, plus mirror and tested restore |
| Backups | GitLab only, restore untested | Plus Longhorn target and snapshots |
| Patching | worker-node-A up 47.9 weeks | Rolling patch, one node at a time |
| DO cost | $186/month | About $198/month |
| Home RAM | About 42 GiB, 77% used | Unchanged (accepted risk) |
| Home power | No UPS | 1500 VA UPS with NUT |
| Home router | RouterOS 6.47.8 (2020) | Latest RouterOS 6 LTS |
| Home k3s versions | mac-mini v1.35, rest v1.34 | Aligned |
| Platform | k3s on Droplets plus home k3s | Same, no DOKS |
Notes on the table:
- Backups today: GitLab is backed up nightly to mac-mini (2 newest copies, registry images skipped). Droplet backups are off. Longhorn and other data are unconfirmed.
- Home RAM: the mac-mini VM stays at about 8 GiB, so losing a NUC is an accepted risk for now.
- Home power: the switch and router restarted together on 2026-11-11, which may have been a power cut. The UPS gives about 50–70 minutes at typical load.
2.2 Resources after the plan¶
DigitalOcean (monthly prices approximate):
| Item | Today | After | Cost |
|---|---|---|---|
| worker-node-A | 2 vCPU, 8 GB | No change | $42 |
| control-plane | 4 vCPU, 8 GB | No change, trim ArgoCD | $48 |
| gitlab-haproxy | 8 vCPU, 16 GB | No change | $96 |
| Load balancer | None | One DO LB | About $12 |
| DO total | $186 | About $198 |
- Cloud RAM stays at 31 GB in total on purpose. It is already 60–81% used.
- gitlab-haproxy stays at 8 vCPU, 16 GB, 320 GB disk, $96.
Home (electricity is free, so the cost is hardware only):
| Item | Today | After | Cost |
|---|---|---|---|
| nuc-a (i7-1360P) | 16 threads, 15 GiB | No change | $0 |
| nuc-b (i5-1340P) | 16 threads, 15 GiB | No change | $0 |
| castis-desktop | 4 threads, 4 GiB | No change | $0 |
| mac-mini (M4) | VM with 8 GiB | No change | $0 |
| UPS | None | 1500 VA, NUT | 7,000–12,000 THB |
| Router | RouterOS 6.47.8 | Latest 6 LTS | $0 |
| Switch | Ruijie, 0 W PoE | No change, on UPS | $0 |
- castis-desktop (i5-4210Y) is the weakest etcd member.
- mac-mini has a 32 GB M4 host, but its VM stays as it is.
3. Our infrastructure today¶
3.1 DigitalOcean Droplets¶
The public edge runs on three DigitalOcean Droplets in Singapore (SGP1), which form their own k3s cluster. The workloads sit on that cluster, not just the gateway. A separate home cluster connects to it over Tailscale/Headscale.
| Droplet | Plan | Price |
|---|---|---|
| worker-node-A | 2 vCPU, 8 GB, 100 GB disk | $42/mo |
| control-plane | 4 vCPU, 8 GB, 80 GB disk | $48/mo |
| gitlab-haproxy | 8 vCPU, 16 GB, 320 GB disk | $96/mo |
| Total | $186/mo |
Full names and roles:
- ubuntu-worker-node-A: k3s worker running APISIX, Longhorn and acme-dns (34 pods).
- ubuntu-24-04-LTS-control-plane: k3s control plane running ArgoCD, APISIX and Longhorn (98 pods).
- ubuntu-mashup-gitlab-haproxy: GitLab, CI, APISIX and Longhorn (70 pods).
Around these Droplets sit a DO Load Balancer (to be confirmed), Tailscale/Headscale links to the home cluster, and Longhorn replicated storage across all three nodes. The PlayTelly project in the DO console may hold more resources (load balancer, volumes, snapshots). It was not checked.
3.2 What the Droplet usage data says¶
The nodes have spare CPU but little spare RAM. The figures below are from a one-hour Grafana window (VictoriaMetrics), so they must be confirmed over 30 days.
| Node | CPU used | RAM used | Uptime |
|---|---|---|---|
| worker-node-A | 0.67 of 2 (33%) | 4.67 of 7.75 GiB (60%) | 47.9 weeks |
| control-plane | 1.24 of 4 (31%) | 6.26 of 7.76 GiB (81%) | 23.4 weeks |
| gitlab-haproxy | 1.84 of 8 (23%) | 12.2 of 15.6 GiB (78%) | 9.7 weeks |
- Total RAM in use is about 23 GiB of 31 GiB. Removing a whole node would not fit, and Longhorn also wants three nodes for its replicas.
- The GitLab Droplet pays for 8 vCPU but uses about 1.8. GitLab itself is the largest single pod at roughly 5 GiB.
- The control plane at 81% RAM is the tightest node. It runs 98 pods including ArgoCD, so it is at more risk of out-of-memory kills than of being oversized.
- Long uptimes mean pending patches. worker-node-A has not been rebooted for almost a year, so kernel security updates are almost certainly waiting.
3.3 Cloud-side HA design¶
The intended design puts a DigitalOcean Load Balancer in front of three APISIX Droplets, each forwarding over Tailscale to the home cluster; the load balancer is the part that is not in place yet. This section summarises the cloud side of the HA architecture diagram (HA-architecture.html, last updated 2026-08-20) and the HA implementation guide. Home network items are left out on purpose.
Internet
|
DigitalOcean Load Balancer (managed) <- not in place today
|
+--> worker-node-A (APISIX gateway)
+--> control-plane (APISIX gateway)
+--> gitlab-haproxy (APISIX gateway, GitLab and CI)
|
Tailscale mesh (SaaS coordination)
|
Home private cluster (out of scope here)
Each APISIX Droplet forwards independently to the three home upstream nodes and health-checks them itself, so the Droplets share no state. All three Droplets are in SGP1, so one region is the remaining cloud-side single point.
Design decisions on the cloud side:
- DO Load Balancer, not MetalLB. The managed load balancer targets the three Droplets (by their tags) and health-checks them. It replaces the MetalLB virtual IP on the DO cluster. Remove MetalLB only after the load balancer is live and passing traffic.
- Tailscale SaaS, not Headscale. Headscale has no supported HA mode, so self-hosting it would swap one single point of failure for a harder one. The repo still holds Headscale docs, so confirm which one is live.
- No shared state between gateways. Each APISIX node lists the home nodes' own Tailscale IPs as upstreams. The list is kept in sync by hand when the home cluster changes.
- GitLab stays on DO. ArgoCD reads its repositories from GitLab, so GitLab is part of the HA path and is not moved out to save cost.
Failure domains on the cloud side:
| Failure | Covered? | How |
|---|---|---|
| One Droplet or APISIX down | Yes, once the LB is live | LB health check routes around it |
| Entry point today (no LB) | No | Depends on one DNS-pointed IP |
| DO Load Balancer itself | Yes | Managed and HA by DO |
| Tailscale control-plane blip | Mostly | SaaS is HA; traffic is P2P or DERP |
| Headscale as a single point | Avoided | Not in the design (confirm) |
| Whole SGP1 region | Partial | All 3 Droplets share one region |
| GitLab Droplet down | No | One pod; others lack its ~5 GiB |
- Failover times are not yet measured. The original guide leaves them blank until its verification test is run after the load balancer is live.
- Entry point today: an outage lasts until someone changes DNS.
- GitLab Droplet down: recovery means restoring from the nightly backup on mac-mini, and that restore is not yet tested.
3.4 Home cluster¶
Four nodes form a k3s cluster at home. castis-desktop, nuc-a and nuc-b are the three control-plane and etcd nodes (k3s v1.34.5, Ubuntu 22.04). mac-mini is the only worker, a Debian 12 VM running k3s v1.35.5 on an Apple M4 host with 32 GB. etcd keeps quorum with any two of the three control-plane nodes.
Readings from kubectl top nodes. Sizes are worked out from the percentages, so they are approximate.
| Node | CPU used | RAM used | Approx. size |
|---|---|---|---|
| nuc-a | 1686m (10%) | 11.8 GiB (75%) | 16 threads, 15 GiB |
| nuc-b | 2044m (12%) | 12.1 GiB (77%) | 16 threads, 15 GiB |
| castis-desktop | 1069m (26%) | 2.9 GiB (77%) | 4 threads, 4 GiB |
| mac-mini VM | 148m (2%) | 5.7 GiB (73%) | VM about 8 GiB |
- CPU is light everywhere (2–26%), so these machines draw little power. castis-desktop is a low-power Intel Core i5-4210Y (2 cores, 4 threads) with 4 GiB RAM, and it is the weakest etcd member.
- RAM is 73–77% on all four nodes as the cluster sees them. About 33 GiB is in use of roughly 42 GiB. If one NUC fails, its roughly 12 GiB would not fit in the roughly 6–7 GiB free on the other three nodes, so the home cluster cannot fully absorb a NUC failure today.
- The mac-mini VM stays at about 8 GiB, so this risk is accepted for now. Options for later: trim pod memory use, or add RAM to the NUCs (check the supported maximum for the model).
- The mac-mini host has a steady 10 W GPU draw, which a headless server should not need. Check what uses the GPU (VM display acceleration or an AI job such as speech-to-text).
3.5 Home network gear¶
- Switch: Ruijie S2910-24GT4SFP-UP-H, RGOS 11.4(1)B70P1, hardware 3.90. A 24-port gigabit PoE switch.
show powerreports the internal power supply as ok. PoE load read on 2026-11-19: 0 W, no PoE port powered (370 W PoE budget unused). - Router: MikroTik RB951Ui-2HnD (r2), RouterOS 6.47.8 from November 2020, single-core 600 MHz, CPU load 10%.
/system health printreturned nothing, so this model has no power sensor. Use the datasheet figure. - Restart evidence: the switch reports a start time of 2026-11-11 04:36, and the MikroTik's uptime matches it within minutes. That fits a power cut or maintenance, so confirm which it was.
3.6 Backups today¶
- GitLab: backed up nightly to mac-mini by the script described in GitLab backup. It runs at 02:00, keeps the 2 newest copies and skips container registry images. Failures are silent, so check
/var/log/gitlab-backup-offsite.log. - Droplet backups: off.
- Longhorn volumes, ArgoCD secrets, etcd snapshots: not confirmed anywhere.
- Restore test: never done.
4. Why we chose this plan¶
4.1 Why the DO bill cannot shrink¶
A Droplet plan is a bundle of CPU, RAM and disk with one price. In the regular Basic line, doubling the plan doubles all three and doubles the price: 4 vCPU, 8 GB, 160 GB costs $48, and 8 vCPU, 16 GB, 320 GB costs $96. You cannot buy "less CPU" on its own.
- To pay less you must give up RAM or disk. The GitLab Droplet needs its 16 GB of RAM (78% used) and its 320 GB disk, so neither can go.
- The next plan down is 8 GB (4 vCPU, 160 GB, $48). To fit, usage would have to drop from 12.2 GiB to about 6.5 GiB. GitLab alone is about 5 GiB, and trimming other pods frees only 1–2 GiB, so GitLab would have to leave the Droplet. That is not chosen.
- A smaller disk means a new Droplet. A disk can grow but never shrink, so the 160 GB or 200 GB plans need a rebuild and a restore, not a resize.
Plans with 16 GB RAM or 4 vCPU (from DO's website):
| Plan | vCPU / RAM | Disk | $/month |
|---|---|---|---|
| Today: Basic regular | 8 / 16 GB | 320 GB | $96 |
| Premium AMD | 4 / 16 GB | 200 GB | $84 |
| Premium Intel | 4 / 16 GB | 320 GB | $96 |
| General Purpose (dedicated CPU) | 4 / 16 GB | 50 GB | $126 |
| Memory-Optimized | 2 / 16 GB | 50 GB | $84 |
| Basic regular, for reference | 4 / 8 GB | 160 GB | $48 |
- No 6 vCPU plan exists in DO's current tables or in the Premium release note.
- Premium Intel keeps the 320 GB disk with 4 vCPU, but costs the same $96, so it saves nothing. Premium CPUs are faster, so DO charges the same for fewer cores.
- Premium AMD saves $12 ($144 a year), but only because it has 120 GB less disk. We keep the 320 GB disk, so it is ruled out.
- General Purpose and Memory-Optimized have only 50 GB of disk, which is too small for GitLab here.
- The Premium AMD and Premium Intel prices come from DO's release note, because the Premium tabs were not readable on the pricing page. Confirm them in the resize dialog before acting.
v5 Droplets (newer, priced per resource):
v5 is a newer Droplet type on 5th-generation AMD EPYC processors where you choose vCPU, memory and boot disk separately, and each is priced on its own.
- Rates from DO's docs: about $0.0158 per hour per shared vCPU, $0.0040 per hour per GiB of memory and $0.000137 per hour per GiB of boot disk.
- Shared or dedicated: shared vCPUs (1–8 vCPU, 1–24 GB, 1–3 GB per vCPU) can be shared with other Droplets. General Purpose vCPUs are dedicated and cost more (about $0.028 per hour each).
- Limits: a v5 Droplet can only be resized to other v5 configurations, and its boot disk can grow but never shrink. v5 may not be offered in every datacenter.
Estimated monthly price for the GitLab Droplet on v5 (rates × 672 hours, the monthly cap; approximate):
| Configuration | $/month |
|---|---|
| Today: Basic regular, 8 vCPU, 16 GB, 320 GB | $96 |
| v5 shared, 6 vCPU, 16 GB, 320 GB disk | About $136 |
| v5 shared, 8 vCPU, 16 GB, 320 GB disk | About $157 |
- v5 costs more than today's plan here. The 320 GB boot disk alone would cost about $29/month on v5.
- 16 GB needs at least 6 vCPU on v5 if the limit of 3 GB per vCPU holds, so v5 cannot give 4 vCPU with 16 GB anyway.
- Verdict: v5 does not help this Droplet.
Storage types on DigitalOcean:
| Type | Used for | Price |
|---|---|---|
| Droplet disk (bundled) | OS and data on the Droplet | Included in the plan price |
| Block Storage volume | Extra disk attached to one Droplet | $0.10 per GB per month ($10 per 100 GB) |
| Spaces object storage | Backups, files, images (S3-style) | $5/month with 250 GB and 1 TB transfer; $0.02 per extra GB |
| Snapshots | One-off copy of a Droplet or volume | $0.06 per GB per month |
| Droplet backups | Automatic scheduled copies | About 20% of the Droplet price (not confirmed on the page I read) |
- Droplet disk: fixed by the plan. It is fast local SSD or NVMe, it can grow only by moving to a bigger plan, and it can never shrink. It is also your cheapest storage: your 320 GB would cost about $32/month as a volume.
- Block Storage volume: a separate disk you attach to one Droplet in the same region. You can add or grow volumes without changing the Droplet plan, which suits extra Longhorn or GitLab data, but it adds cost.
- Spaces: not a disk. It stores files through an S3-style API, so it suits backups and archives. At $5/month for 250 GB it could hold the GitLab backups off-site if the mac-mini copy is not enough.
- Snapshots: a safety copy before a change, such as a resize or upgrade. They are billed by the data stored, so delete old ones.
- Droplet backups: currently off. They cost a share of the Droplet price, and snapshots before changes are cheaper for this case.
The GitLab node's disk matters. GitLab data (/data/gitlab), the Longhorn replicas and the backup staging folder all share one disk of about 310 GB. Check how much is really used (commands in Appendix A).
4.2 Options we considered¶
Option 1: stay on Droplets and keep their sizes (chosen)¶
Keeps the Droplet sizes as they are: cutting CPU would save nothing while RAM and the 320 GB disk stay. This is the safest option and needs no migration.
- Do not shrink the GitLab Droplet. It uses about 1.8 vCPU, but the disk stays at 320 GB, and with that disk no cheaper plan exists (see 4.1).
- Leave the two 8 GB Droplets at their size. Their RAM use is 60% and 81%, so a 4 GB plan cannot hold them.
- Trim what runs on the control plane (unused ArgoCD parts such as dex or notifications, idle apps). This does not cut the bill by itself, but it gives the 81% node safe headroom.
- Clean up the account. Check for old snapshots, unattached volumes and unused Reserved IPs. Automated backups are already off.
Assessment: estimated saving $0 on the Droplets, no effort beyond a short trim of idle ArgoCD parts, and low risk.
Option 2: managed Kubernetes (DOKS) instead of k3s on Droplets (not chosen)¶
This reduces operations work but not the bill, and the migration is large. The cluster already runs k3s on Droplets, so the realistic "k3s but in DO" alternative is DigitalOcean's managed Kubernetes service (DOKS).
- Control plane: free on the standard tier, with an optional high-availability control plane at roughly $40/month (approximate). Today the control-plane Droplet costs $48 and also runs workloads.
- Workers: priced the same as Droplets of the same size. About 23 GiB of RAM in use still needs about the same worker capacity.
- Storage: DO block storage replaces Longhorn at about $0.10 per GB per month (approximate). This frees Longhorn's RAM but adds a volume bill.
- Load balancers: each Service of type LoadBalancer creates a DO load balancer at about $12/month.
- What improves: no control plane to patch, built-in upgrades, native block storage, DOCR registry option.
- What gets harder: less control over k3s settings, MetalLB and APISIX setup must be redone, Tailscale must be re-added to the new nodes.
- Effort: high. Rebuild the cluster, restore every volume, repoint ArgoCD, DNS and certificates.
- Verdict: estimated saving about $0, possibly an increase. Not recommended for cost. Consider only if reducing operations work matters more than money.
Option 3: other options (not chosen)¶
None of these is chosen: GitLab must stay on DO for ArgoCD high availability, so the options below are kept for reference only. Each trades a larger saving for more risk or a larger migration.
3A. Hybrid: GitLab and CI move to a home node. GitLab is about 5 GiB and the largest workload on the 16 GB Droplet.
- After GitLab leaves, that Droplet still carries roughly 7 GiB (Longhorn, APISIX, monitoring). That is tight on an 8 GB plan, so move or trim a little more first (for example Grafana or VictoriaMetrics).
- Then resize the Droplet from 16 GB ($96) to the 8 GB class (about $48), saving about $48/month.
- Needs: a NUC with spare RAM and disk, a tested GitLab backup and restore, and a maintenance window for CI. It also breaks the HA rule, because GitLab would no longer be on DO.
3B. GitLab as a hosted service (GitLab.com). Same effect on the Droplet as 3A, but the GitLab server is no longer ours. It adds a per-user fee and changes runners and repository URLs. Compare the per-user price with $48 before choosing it.
3C. Move everything to the home cluster. Saves the whole $186, but the DO Droplets are the public entry point (public IP, TLS and DNS). A home uplink would need a stable public address or a tunnel such as Cloudflare Tunnel. Home RAM is also short (77% used), and the mac-mini VM cannot be enlarged. This is a separate project with a high outage risk if rushed.
3D. Move to a cheaper VM provider. A web search for 16 GB and 8 GB VPS prices gave mixed-date figures from comparison sites, so treat them as rough and get a real Singapore quote before deciding.
- Vultr and Linode (Akamai): about $80–96 for 16 GB and about $40–58 for 8 GB, which is in line with DO's $96 and $48. No saving.
- Hetzner: its cloud prices rose sharply in 2026 (reports of the CPX line up 144–175% from June 2026), and some sources note limited availability. It is no longer a clear saving.
- Contabo: the cheapest on paper, roughly $15/month for a 16 GB VPS with about 400 GB of NVMe disk. It is known for lower and less consistent performance, so test it before trusting it with GitLab or etcd.
- Other costs of leaving DO: a full migration with a new public IP, a latency check for Thailand and Singapore users, and no DO Load Balancer for servers outside DO, so the HA design would need a different front door.
- Verdict: DO's price is already in line with the big providers. Only budget providers like Contabo are far cheaper, with performance and HA trade-offs. Worth a trial only if cost matters more than consistency, for example with one non-critical node.
4.3 Options side by side¶
With GitLab staying on DO, Option 1 is the only choice that applies, and the load balancer is an added cost. Current cost is $186/month; the figures are approximate.
| Option | Saving per month | Effort / risk | Verdict |
|---|---|---|---|
| 1. Stay as is, trim idle parts | $0 | Hours / low | Chosen |
| 2. DOKS | About $0 | Weeks / medium | Skip |
| 3A. GitLab to home | About $48 | Days / medium | Not chosen (HA) |
| 3B. GitLab.com | About $48 less fee | Days / medium | Compare fee |
| 3C. Everything home | Up to $186 | Weeks / high | Not now |
| 3D. Cheaper provider | Needs a quote | Weeks / high | Only if DO not needed |
4.4 How hard is migration?¶
Stateless apps move easily because ArgoCD already holds their manifests in git; the stored data is the hard part. The table rates each component for any option that moves workloads.
| Component | Difficulty | Why |
|---|---|---|
| Stateless apps (APISIX, website, docs) | Easy | ArgoCD redeploys from git |
| ArgoCD and its secrets | Medium | Re-point; recreate secrets not in git |
| GitLab | Medium | Restore, runners, URLs, downtime |
| Longhorn and VictoriaMetrics data | Hard | Per-volume restore; no target found |
| Public IP, DNS, TLS | Medium | IP is in DNS and APISIX; short TTL |
| Headscale and Tailscale links | Medium | Re-join nodes, keep HA |
Rough effort: moving GitLab to a home node takes a few days of work plus one maintenance window. A full provider or platform move takes one to three weeks and needs a rollback plan.
4.5 Risks and prerequisites¶
The biggest risk today is not cost: recovery is untested. GitLab already has a nightly backup to mac-mini, but a restore has not been proven and other data is not covered. Fix that before touching anything, because a failed resize or migration needs a proven way back.
- Backups are partial. GitLab is backed up nightly to mac-mini (the 2 newest copies are kept, and container registry images are skipped). Not covered or unconfirmed: registry images, Longhorn volumes, other data, and Droplet backups are off. Test a restore, check the backup log because failures are silent, add a Longhorn backup target (NFS on a NUC, or Spaces at roughly $5/month), and take a Droplet snapshot before each change.
- Patching. worker-node-A has been up 47.9 weeks. Patch and reboot one node at a time, draining it first and waiting for Longhorn volumes to be healthy before the next.
- Control-plane memory. At 81% RAM with 98 pods, it is the node most likely to fail. A single control plane on DO is also a single point of failure for the cluster.
- Version skew on the home cluster. The mac-mini worker runs k3s v1.35.5 while the control plane runs v1.34.5. Kubernetes does not support a kubelet newer than the API server, so align the versions (upgrade the three control-plane nodes first, or move mac-mini back to v1.34).
- Old home router. The MikroTik RB951Ui-2HnD runs RouterOS 6.47.8 from November 2020, so it is missing years of security fixes. Back up its configuration and update to the latest RouterOS 6 long-term release. Check its datasheet too: this model has fast-Ethernet (100 Mbps) LAN ports, which would cap the home uplink (confirm).
- Home cluster memory. All four home nodes are at 73–77% RAM, so losing one NUC would leave about 5–6 GiB too little to reschedule its pods. The mac-mini VM stays as it is, so the risk is accepted for now.
- Thin evidence. The Grafana figures cover one hour. Check the last 30 days of peak memory before acting.
- No billing view. The Modifier role cannot see Billing, so the real monthly total, any load balancer and any bandwidth overage are unknown. The account Owner or a Biller must share the invoice.
- Resize limits. A disk can grow but never shrink on DO, so a smaller disk means a new Droplet. A CPU and RAM only resize can be reversed.
4.6 Why a UPS for the home servers¶
- An abrupt power cut can corrupt etcd and Longhorn volumes on the home k3s nodes.
- The Ruijie switch and the MikroTik both restarted at about the same time on 2026-11-11, which fits a power cut or maintenance.
- Without the switch, MikroTik and modem there is no uplink and no Tailscale path to the DO edge, even if the servers survive.
- Electricity at the site is free, so the home servers have no running cost. That makes the home cluster cheaper to rely on, but only if its power is protected.
5. How to apply the plan¶
5.1 Roadmap¶
Do safety work first, then the load balancer, then patching and trimming idle parts; GitLab stays on DO and gets a mirror and backups instead of a move. Each phase has a gate before the next starts.
- Phase 0: safety and facts (week 1).
- Take a snapshot of each Droplet and check the nightly GitLab backup log.
- Confirm what else is backed up (Longhorn volumes, ArgoCD secrets) and set up a Longhorn backup target if not.
- Get the invoice from the account Owner (check snapshots, volumes, Reserved IPs and the PlayTelly project) and read 30 days of Grafana memory peaks.
- Gate: a restore of GitLab from backup has been proven on a test host.
- Phase 1: load balancer (weeks 1–2).
- Create a DO Load Balancer that targets the three Droplets by tag, with TCP passthrough on ports 80 and 443 and a health check on APISIX.
- Lower the DNS TTL, switch DNS to the load balancer, and keep the old record for rollback. Then remove the MetalLB leftovers.
- Gate: stop APISIX on one Droplet and confirm traffic continues; record the failover time.
- Phase 2: patching (weeks 2–3).
- Patch and reboot one node at a time with drain and uncordon.
- Gate: all Longhorn volumes healthy after each reboot.
- Phase 3: trim idle parts (weeks 3–4).
- Trim idle parts on the control plane (unused ArgoCD parts) to lower its RAM use. The Droplet sizes and disks stay as they are.
- Gate: 30-day memory peaks stay under about 85% on every node.
- Phase 4: protect GitLab in place (weeks 4–6).
- Push-mirror the repositories ArgoCD reads to a second location, and keep the existing nightly GitLab backup.
- Restore the backup to a home node once to prove recovery (use a node with spare RAM and disk).
- Gate: ArgoCD syncs from the mirror in a test.
- Phase 5: local power (in parallel, weeks 1–4).
- Measure the real watts, install the UPS, set up NUT and the staged shutdown.
- Gate: a pull-the-plug test ends in a clean shutdown and a clean recovery.
- Phase 6: home fixes (weeks 4–6).
- Back up the MikroTik configuration and update RouterOS.
- Upgrade the three control-plane nodes so the k3s versions match mac-mini, or move mac-mini back to v1.34.
- Gate:
kubectl get nodesshows matching versions and all nodes Ready.
- Phase 7: review (later).
- Decide whether a cheaper provider (3D) or the full move home (3C) is worth a separate project, using the real invoice. Home electricity is free, so the home side only costs hardware and upkeep.
5.2 Load balancer setup¶
- Create the load balancer in SGP1, in the same VPC as the Droplets (
default-sgp1). Expect about $12/month for the smallest size (confirm in the console). - Targets: the three Droplets by tag (
worker-node-A,control-plane,worker-node), so a replaced Droplet is picked up automatically. - Forwarding: TCP 80 to 80 and TCP 443 to 443 as passthrough, so APISIX and cert-manager keep handling TLS and no certificate change is needed.
- Health check: a simple check on the APISIX port, so a failed gateway is dropped from rotation.
- Real client IPs: enable PROXY protocol only if you need them, and only if APISIX is configured to read it.
- DNS cutover: lower the TTL first, point DNS at the load balancer, and keep the old record for rollback.
- After it is proven, remove the MetalLB virtual IP from the DO cluster.
- Cheaper alternative: a Reserved IP with a failover script avoids the $12, but it is active-passive and you must maintain the script. The load balancer is the better choice.
5.3 Local power and UPS plan¶
Put the home servers (nuc-a, nuc-b, castis-desktop and mac-mini), the switch, the MikroTik and the ISP modem on one line-interactive, pure-sine UPS of about 1500 VA, and shut the servers down cleanly with NUT before the battery runs out. The wattages below are estimates from measured CPU package power and typical hardware. A wall meter or smart plug will confirm the real draw.
What needs protection¶
| Device | Draw (estimate) | Why on the UPS |
|---|---|---|
| nuc-a, nuc-b | 15–25 W each | etcd nodes |
| castis-desktop | 12–20 W | etcd node |
| mac-mini | 18–30 W | VM host |
| Ruijie switch | 30–50 W | No switch, no cluster |
| MikroTik router | 5–10 W | No router, no Tailscale |
| ISP modem or ONT | 10–15 W | No uplink |
| Total | 105–175 W typical | About 300 W peak |
Notes on the table:
- nuc-a (i7-1360P) and nuc-b (i5-1340P): measured CPU package 7–8 W, up to 65 W at peak. They are k3s control-plane and etcd nodes, and an abrupt cut can corrupt etcd and Longhorn volumes.
- castis-desktop (i5-4210Y, 4 GiB RAM): measured CPU package 4 W, up to about 25 W at peak. It is a k3s control-plane and etcd node and one of the APISIX upstreams.
- mac-mini (M4, 32 GB): measured SoC 14.6 W, up to about 65 W at peak. It is the home worker VM host and carries no public traffic.
- Ruijie switch: PoE load measured at 0 W, so this is the base draw. Adding PoE devices later raises it.
- MikroTik RB951Ui-2HnD: the datasheet maximum is about 7 W without attachments (confirm).
- Total: about 130 W central, about 300 W peak. These are the four home nodes shown by
kubectl get nodes, and the CPU loads are light (2–26%), so the draw sits at the low end. If there is a fifth server, add its watts.
UPS sizing (approximate)¶
Choose a UPS whose watt rating is at least 1.3 times the peak load, so 300 W needs about 390 W or more. Keep the load under 70% of the rating, which means about 430 W. A 1000 VA unit (about 600 W) covers it, and 1500 VA (about 900 W) gives headroom and more runtime. An external battery pack adds time.
| Option | Fit | Rough price |
|---|---|---|
| A. 1000 VA line-interactive | Minimum, shorter runtime | 4,000–7,000 THB |
| B. 1500 VA line-interactive (recommended) | Headroom and runtime | 7,000–12,000 THB |
| C. 1500 VA online | Best if mains is unstable | 15,000–30,000 THB |
| D. Battery pack or generator | Only for outages of hours | Depends on outages |
All options are pure sine. Prices are rough local figures, so check a supplier.
How long the UPS survives (approximate)¶
Estimated runtime on a new battery of the usual size (about 170–220 Wh, of which 50–70% is usable). The vendor's runtime chart for the exact model is the authority.
| Load | Meaning | 1000 VA | 1500 VA |
|---|---|---|---|
| 80 W | Light | 55–90 min | 80–110 min |
| 130 W | Typical | 35–55 min | 50–70 min |
| 200 W | Busy | 22–36 min | 33–45 min |
| 300 W | Peak | 15–23 min | 22–30 min |
- A battery older than about 3 years has lost roughly 30–40% of its capacity, so cut these figures accordingly.
- Reserve 5–10 minutes for the staged shutdown, so trigger it at about 10 minutes remaining (or 50% charge).
- The UPS only helps if the modem and the ISP's own equipment stay up. A neighbourhood-wide outage can take the uplink down even when your UPS is fine.
- Target at least 15–30 minutes of runtime. A single UPS is one failure point, but two UPS units do not remove the network single point (one switch, one MikroTik), so one good UPS plus a tested spare battery is better value.
Electricity cost¶
Electricity at the site is free, so the home servers and the UPS add no running cost. The only cost is the UPS purchase and a battery replacement every 3–4 years. Still measure the real watts, because they decide the UPS size and the battery runtime, not the bill.
Shutdown and recovery plan¶
- Connect the UPS by USB to one NUC running NUT (Network UPS Tools server). The other servers run NUT clients over the LAN.
- Staged shutdown at low battery (for example 50% or 5 minutes left): shut mac-mini down first because it carries no public traffic. Then stop k3s on the other client nodes so Longhorn volumes detach cleanly and shut them down. Shut the NUT server node down last.
- Set each server's BIOS to power on after AC loss. The switch and MikroTik start by themselves.
- Recovery order: modem, MikroTik and switch first, then the servers. k3s etcd runs on castis-desktop, nuc-a and nuc-b and needs any two of them up, so check quorum and Longhorn health before declaring recovery.
- During an outage the DO edge keeps running. APISIX health checks drop the unreachable home upstreams.
Good practice¶
- Use a dedicated circuit with surge protection and a proper earth ground, and keep the load under 70% of the UPS watt rating.
- Keep the UPS cool: batteries last about 3–5 years at 25°C, and heat shortens that. Replace them every 3–4 years.
- Alert on "on battery" through NUT to email, Telegram or Grafana.
- Run a pull-the-plug test every quarter and log the result.
- Optional: a 4G/5G backup WAN on the MikroTik for ISP failures, powered from the same UPS.
6. Open questions¶
These answers would change the numbers or the plan.
- What does the invoice show (Billing → Usage)? Is there a load balancer, volumes, snapshots or bandwidth overage?
- What is in the PlayTelly project besides the three Droplets?
- What are the 30-day peak RAM and CPU figures for each node in Grafana?
- How much disk does the GitLab node really use (
df -h /)? The disk stays at 320 GB, so check it does not fill up. How many Longhorn replicas are set? - Has a GitLab restore from the mac-mini backup ever been tested, and is the nightly job's log clean?
- Are Longhorn volumes, ArgoCD secrets or etcd snapshots backed up anywhere?
- Does a NUC have spare RAM (at least 8 GiB) and disk to host a GitLab restore?
- How many GitLab users and CI runs per day are there, and how much downtime can they tolerate?
- Is Headscale or Tailscale SaaS the live coordination plane?
- Must the public entry stay on DO, or could a tunnel or other provider serve it?
Local power
- What is the measured wattage of the NUCs, castis-desktop, mac-mini, the switch, the MikroTik and the modem?
- Are there only four home nodes (nuc-a, nuc-b, castis-desktop, mac-mini), or is there a fifth server?
- Did the Ruijie switch and the MikroTik both restart on 2026-11-11 because of a power cut or planned maintenance?
- How often and how long are mains outages at the site?
- Is a generator or long-outage plan needed?
Appendix A. Commands to check things¶
Only a wall meter or smart plug shows the whole machine's power. Software readings show the CPU part and miss the motherboard, drives and fans, so add roughly 10–20 W to them.
Measured so far (2026-11-19):
| Node | Software reading | At the wall (estimate) |
|---|---|---|
| castis-desktop | CPU package 4 W | About 12–20 W |
| nuc-a | CPU package 7 W | About 15–25 W |
| nuc-b | CPU package 8 W | About 15–25 W |
| mac-mini host | SoC 14.6 W | About 18–30 W |
- castis-desktop: Intel Core i5-4210Y (2 cores, 4 threads), Ubuntu 22.04.4.
- nuc-a: Core i7-1360P, Ubuntu 22.04.5.
- nuc-b: Core i5-1340P, Ubuntu 22.04.4.
- mac-mini host: Apple M4, 32 GB, macOS 26.6.2. The reading is CPU 4.1 W plus GPU 10.4 W.
Check the operating system and hardware of every node (from any machine with kubectl):
Disk use on the GitLab node:
Linux (nuc-a, nuc-b, castis-desktop):
CPU package power over 10 seconds (Intel RAPL, needs root):
sudo sh -c 'e1=$(cat /sys/class/powercap/intel-rapl:0/energy_uj); sleep 10; e2=$(cat /sys/class/powercap/intel-rapl:0/energy_uj); echo "CPU package watts: $(( (e2 - e1) / 10 / 1000000 ))"'
Live view with turbostat (install it with sudo apt install linux-tools-common linux-tools-$(uname -r)):
If castis-desktop has an NVIDIA GPU:
macOS (the mac-mini host, not the VM inside it):
CPU, GPU and neural engine power on Apple Silicon:
Run it while the VM is busy, and read the line "Combined Power (CPU + GPU + ANE)". A reading inside the Linux VM cannot see the host's power.
MikroTik (RouterOS terminal, or WinBox → New Terminal):
routerboard print gives the model, which you can look up in MikroTik's datasheet for "max power consumption". health print shows voltage, temperature and, on some models, current and power consumption. If it powers other devices over PoE, also run:
Ruijie switch (SSH or console, then enable):
show version gives the model and software, which you can look up in Ruijie's datasheet for maximum power. show power reports power-supply status. show poe powersupply reports the total PoE power drawn. For the modem or ONT, use the figure printed on its power adapter (output volts × amps) or the wall meter.
Find out whether the 2026-11-11 restart was a power cut:
On MikroTik, a line like "router was rebooted without proper shutdown" means an abrupt stop. On the Ruijie, run show logging and look near 2026-11-11 04:36. On Linux, run last -x reboot shutdown | head -8, and on the mac-mini host run last reboot | head -5.
Appendix B. Sources¶
- DO Droplet pricing: Basic regular, General Purpose and Memory-Optimized plans.
- DO release note on Basic Premium plans: Premium AMD and Premium Intel prices.
- DO Droplet pricing docs and features docs: v5 per-resource rates and limits.
- DO Block Storage volumes, Spaces and snapshots: storage prices.
- Hetzner price increases, 16 GB VPS comparison, 8 GB VPS comparison and Contabo pricing: rough prices at other providers.
- In the repo: the HA architecture diagram (
HA-architecture.html), the HA implementation guide and the GitLab backup guide.