Skip to content
项目

关于

Three-node HA Kubernetes homelab on Talos Linux: Cilium, Gateway API, cert-manager, Cloudflare Tunnel, Tailscale. Companion repo for the blog series.

系统与基础设施

这些数字如何统计

实测星标增长

24小时
0
7天
+1
15天
+22
1个月
+56

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Homelab

Cybertron: a three-node, highly available Kubernetes cluster on Talos Linux, with Cilium, cert-manager, Cloudflare Tunnel, Tailscale, Longhorn, VictoriaMetrics, Grafana, Argo CD, External Secrets and Bitwarden

validate Talos 1.14 Kubernetes 1.37 Cilium 1.20 License: MIT Blog

Commands and manifests for Cybertron, a three-node Talos Linux Kubernetes cluster on refurbished mini PCs, as built in the blog series. Each folder matches one part.

It's a cluster to break on purpose: networking, storage, observability, GitOps, upgrades and node failures on real machines, real Ethernet and real disks, without paying for cloud resources or breaking an environment someone else depends on.

Part Post Folder
1. A highly available cluster with Talos Linux Building a 3-Node Highly Available Kubernetes Homelab with Talos Linux talos/
2. Networking: Cilium, Gateway API, cert-manager, Cloudflare Tunnel Networking a 3-Node Kubernetes Homelab with Cilium, Gateway API and Cloudflare Tunnel networking/
3. Remote access with Tailscale Tailscale on Talos Linux: Secure Remote Access to a Kubernetes Homelab tailscale/
4. Omni Importing an Existing Talos Cluster into Omni omni/
5. Storage with Longhorn Persistent Storage for a 3-Node Talos Homelab with Longhorn storage/
6. Observability with VictoriaMetrics Metrics, Logs and Alerts for a 3-Node Talos Homelab with VictoriaMetrics observability/
7. GitOps with Argo CD GitOps for a 3-Node Talos Kubernetes Homelab with Argo CD gitops/
8. Secrets with Bitwarden and External Secrets Kubernetes Secrets on a Talos Homelab with Bitwarden secrets/

The cluster

Cybertron: kubectl reaches the API through a virtual IP, talosctl talks to each node, etcd runs on all three, and the API survives one node powering off

Three identical machines, all control planes, all running workloads:

Node Address Role
optimus 192.168.1.111 Control plane, etcd, workloads
bumblebee 192.168.1.112 Control plane, etcd, workloads
ratchet 192.168.1.113 Control plane, etcd, workloads
  • Kubernetes API VIP: https://192.168.1.200:6443. Talos moves it to a healthy control plane, so kubectl doesn't depend on any one machine.
  • etcd: three members, quorum two. One node can go down; two can't.
  • No SSH: Talos is immutable and managed through its API. talosctl talks to each node's own IP (machine: config, disks, logs, upgrades); kubectl talks to the Kubernetes API through the VIP.
  • Node addresses come from DHCP reservations on the router. The VIP and the LoadBalancer range are reserved too, so DHCP never hands them to another device.

Hardware

Each node
Machine Dell OptiPlex Micro (refurbished)
CPU Intel Core i5, 8th gen
Memory 8 GB DDR4
Disk 256 GB SATA SSD
Network Wired Ethernet to the home router

Lenovo ThinkCentre Tiny or HP EliteDesk/ProDesk Mini machines work the same way; nothing here depends on Dell.

Networking

Two front doors into Cybertron: public apps through Cloudflare Tunnel and the public Gateway, lab apps on the LAN through the internal Gateway, and lab names unreachable from the internet

Cilium is the CNI and replaces kube-proxy. Apps are reached through one of two Gateways, and the route's parentRef decides which:

Lab apps Public apps
Names <app>.lab.prateek.cloud <app>.prateek.cloud
Reached from The home LAN only The internet
Path LAN → 192.168.1.201 → Gateway internal → pods Cloudflare edge → tunnel → cloudflared ×2 → Gateway public → pods
TLS Let's Encrypt wildcard from cert-manager (DNS-01, so no inbound access needed) Cloudflare's edge certificate
  • LoadBalancer IPs: Cilium LB IPAM hands out 192.168.1.201–205, and L2 announcements make one node answer ARP for each IP (it moves if that node goes down).
  • No open ports at home: public traffic arrives through one shared Cloudflare Tunnel that the cluster opens from the inside.
  • NetworkPolicy is enforced (it wasn't with Flannel), and Hubble shows every flow and drop.

Details and the full migration from Flannel: networking/.

Remote access

Five routes from anywhere: the phone and laptop reach the Gateway and the Kubernetes API through the tailnet and the active node; addresses that aren't routed stay unreachable; when the active node reboots another node takes over

Tailscale runs on all three nodes as a Talos system extension, so kubectl, talosctl and the lab apps work from anywhere with the same addresses, certificates, kubeconfig and talosconfig as at home.

  • Five /32 routes, not the LAN: the three node addresses (Talos API), the API VIP 192.168.1.200 and the internal Gateway 192.168.1.201. The router, phones and everything else on the network stay unreachable.
  • High availability: every node advertises the same routes; one is active and another takes over when it goes down.
  • Access policy: members of the tailnet reach only ports 80/443 on the Gateway, 6443 on the VIP and 50000 on the nodes. The nodes are tagged devices with no key expiry, and the auth key is revoked after they join.
  • No open ports at home, and the Talos API stays reachable even when Kubernetes is down.

Details, the gotchas (node IPs, Cilium MTU, extension config before the upgrade) and the failover test: tailscale/.

Storage

How Longhorn gives a pod a volume: the PVC asks the longhorn StorageClass, Longhorn puts two replicas on bumblebee and ratchet in their longhorn partitions, starts the engine on optimus where the pod runs, and every write goes to both replicas

Each node's single SSD is split in two: a 60 GiB /var for Talos and a 170 GiB user volume at /var/mnt/longhorn. Longhorn replicates volumes across the nodes and is the default StorageClass.

  • Two replicas per volume on different nodes, so a node can go down and Longhorn still has a third node to rebuild the missing copy on. That's 255 GiB of volumes in total.
  • Snapshots every hour, kept for a day; optional backups every night to AWS S3, kept for two weeks.
  • Node failures: a pod on a powered-off node is force-deleted and its volume attaches where the replacement runs.
  • UI at https://longhorn.lab.prateek.cloud, LAN and tailnet only (it has no login).

Details, the EPHEMERAL reset and the failure tests: storage/.

Observability

VictoriaMetrics instead of kube-prometheus-stack, and VictoriaLogs instead of Loki: the same PromQL, dashboards and alert rules, with less RAM on 8 GB nodes.

  • Metrics from every node, pod, Longhorn volume and the control plane (controller manager, scheduler, etcd), kept for a month.
  • Logs from every pod, searchable in the same Grafana.
  • Grafana at https://grafana.lab.prateek.cloud, LAN and tailnet only.
  • Alerts on Telegram, with critical alerts muting the matching warnings, and a Healthchecks.io dead-man check that messages when alerting stops.
  • Metrics and logs sit on a single-replica Longhorn class; Grafana keeps two.

Details and the alert tests: observability/.

GitOps

Argo CD compares each Application in Git with the cluster, syncs a change pushed to Git, and puts back a change made directly in the cluster

Argo CD runs the cluster from this repository: a git push changes the cluster, and a change made directly in the cluster is put back within minutes.

  • App of apps: one root Application, applied once, creates an Application for every file in gitops/apps/.
  • Adopted in place: cert-manager, the Gateways, cloudflared, Longhorn and the observability stack moved from Helm to Argo CD with no reinstall, by keeping the Helm release names.
  • Argo CD manages itself, with its UI at https://argocd.lab.prateek.cloud, LAN and tailnet only.
  • Kept outside: Cilium (Argo CD runs on its network), the Omni patches and one token (see Secrets). Longhorn has prune off.
  • Alerts on Discord when a sync fails or an Application turns Degraded.

Details, the CLI through the Gateway and the rollback: gitops/.

Secrets

Secrets flow from the cybertron Bitwarden project through bitwarden-sdk-server and External Secrets into four Kubernetes Secrets; a deleted Secret is recreated, a value changed in Bitwarden syncs through, and Git holds only references

Every Secret that used to be created manually comes from one Bitwarden Secrets Manager project, synced by External Secrets Operator. The repository holds only references, never values.

  • One store: the bitwarden ClusterSecretStore, logged in with a read-only machine account, through bitwarden-sdk-server over HTTPS with a private CA.
  • Four ExternalSecrets with the same names as the Secrets they replaced: the Cloudflare API token, the tunnel credentials, Alertmanager's config and the Argo CD Discord webhook.
  • One manual Secret: the machine account token, the only thing a rebuild needs.

Details and the tests: secrets/.

Versions

Component Version
Talos Linux 1.14.6
Kubernetes 1.37.2
Cilium 1.20.2
Gateway API CRDs v1.6.1
cert-manager v1.21.2
cloudflared 2026.10.4
Tailscale (Talos extension) 1.102.3
Longhorn 1.13.0
victoria-metrics-k8s-stack 0.98.1
Argo CD v3.6.1 (chart 10.18.0)
External Secrets Operator chart 2.15.0

What's next

  • Next: Authentik in front of every admin UI: one login with two-factor authentication, OIDC for Argo CD and Grafana, and a proxy for the rest.
  • Later: creating Cybertron from Git on a new cluster, and security tooling.

Repository layout

Path What
talos/ Part 1: install, bootstrap and validate the Talos cluster
networking/ Part 2: Cilium, LB IPAM, Gateways, cert-manager, Cloudflare Tunnel, demo app and tests
tailscale/ Part 3: Tailscale extension, subnet routes, access policy, failover
omni/ Part 4: import into Omni, Talos 1.14 node patches, static IPs, undo patch
storage/ Part 5: system extensions through Omni, the Longhorn partition, Longhorn, snapshots, optional S3 backups
observability/ Part 6: control plane metrics through Omni, VictoriaMetrics, VictoriaLogs, Grafana, alerts to Telegram
gitops/ Part 7: Argo CD, the root Application, the earlier Helm releases adopted in place, sync alerts to Discord
secrets/ Part 8: External Secrets Operator, Bitwarden Secrets Manager, every Secret synced from one project
assets/ Diagrams used in this README
.github/workflows/ CI on every push: yamllint, kubeconform (Kubernetes 1.36 and the CRDs used), gitleaks, link check

Replace the domain and 192.168.1.x addresses with your own. Credentials never go in this repository: generated Talos configuration, talosconfig, kubeconfig, API tokens, tunnel, S3, Telegram and Discord credentials stay local (see .gitignore) or in Bitwarden Secrets Manager, synced into the cluster by External Secrets (Part 8).

License

MIT. Use, copy and adapt anything here for your own lab.

Follow the series

For the next parts, follow along on blog.prateekjain.dev, X (@PrateekJainDev) or LinkedIn (in/prateekjaindev).

探索相关项目

加载中…