Hasty Briefsbeta

Bilingual

Cheap Self-Hosted Kubernetes on Hetzner Cloud

2 hours ago
  • terraform-hcloud-kube-hetzner is an open-source Terraform project that simplifies deploying a production-ready K3s cluster on Hetzner Cloud.
  • Hetzner is a German infrastructure provider offering high-performance hardware at reasonable prices, with a solid API and features like private networking, load balancers, and VMs.
  • Kube-Hetzner codifies best practices for running K3s reliably on Hetzner Cloud, handling provisioning, networking, load balancers, node pools, and automated rolling upgrades.
  • It uses openSUSE MicroOS, an immutable, container-centric OS with atomic updates and a read-only root filesystem for security and reliability.
  • K3s is a lightweight, conformant Kubernetes distribution that packages components into a single binary, simplifying cluster operations.
  • The blog plans a highly available cluster with 3 control plane and 3 worker nodes across three Hetzner zones, enabling local-path provisioning and optional Longhorn for replicated storage.
  • Monthly cost estimate: ~€58 with VAT for the described setup, which is cheaper than typical managed Kubernetes services (e.g., $70-$75 on GCP/AWS).
  • Cost-saving options include using a single load balancer, MetalLB, or removing public IPs via a bastion host or VPN.
  • Deployment steps: clone starter project, install Terraform, hcloud CLI, kubectl; run terraform init, plan, apply; retrieve kubeconfig and test connectivity.
  • Backups use K3s' etcd snapshots to S3, and node backups via Hetzner's built-in backup mechanism.
  • Upgrades are handled by Rancher's System Upgrade Controller (SUC) and kured for automated node reboots with configurable maintenance windows.