Optimized and maintenance-free Kubernetes on Hetzner Cloud in one command
open sourceMITself-hostablefree
kube-hetzner is a community Terraform and OpenTofu module that builds a highly available Kubernetes cluster on Hetzner Cloud, running K3s (the default) or RKE2 on openSUSE Leap Micro, an immutable OS with transactional updates and BTRFS rollback (MicroOS stays supported for existing clusters). A createkh script writes a kube.tf and builds the OS snapshots with Packer; then you plan and apply. It wires in Hetzner's cloud controller manager and CSI driver, a choice of Flannel, Calico or Cilium, Traefik, NGINX or HAProxy ingress, automatic OS updates with Kured-coordinated reboots, K3s upgrades through system-upgrade-controller, and Cluster Autoscaler nodepools. It isn't affiliated with Hetzner. MIT.
Problems it solves
- spin up a highly available Kubernetes cluster on Hetzner Cloud from one Terraform file
- run k3s on Hetzner with three control plane nodes and private networking without wiring it all by hand
- keep the OS on my Kubernetes nodes patched automatically, with rollback if an update breaks a node
- reboot Kubernetes nodes one at a time after OS updates without taking the cluster down
- upgrade k3s across a cluster automatically instead of SSHing into every node
- add Hetzner servers to a node pool automatically when pods can't be scheduled, and remove them when idle
- mix cheap Arm and x86 Hetzner servers in the same Kubernetes cluster
- choose Cilium, Calico or Flannel for pod networking on a Hetzner cluster
- run a fully private Kubernetes cluster on Hetzner behind a NAT router with no public node IPs
- spread Kubernetes control plane nodes across several Hetzner locations for resilience
- need RKE2 instead of k3s on Hetzner for a compliance-minded setup
- get Hetzner load balancers and block storage volumes working with Kubernetes out of the box
- reach my cluster's API and SSH only over Tailscale on Hetzner
- add a Hetzner dedicated Robot server to an existing cloud Kubernetes cluster
- manage my Hetzner Kubernetes cluster with OpenTofu instead of Terraform
Features
- k3s (stable default) or RKE2 on openSUSE Leap Micro; MicroOS kept for existing clusters and explicit nodepools
- Automatic OS updates (transactional-update) with reboots coordinated by Kured; automatically_upgrade_os toggle
- Automatic k3s or RKE2 upgrades through Rancher's system-upgrade-controller; automatically_upgrade_kubernetes toggle
- Cluster Autoscaler nodepools (autoscaler_nodepools) next to static agent nodepools
- HA control plane with an odd quorum; multi-location pools
- Hetzner cloud controller manager and CSI driver
- CNI choice: Flannel, Calico or Cilium (XDP, Gateway API, WireGuard encryption)
- Ingress: Traefik (default), community Ingress-NGINX, HAProxy or none; Hetzner load balancer or Klipper
- Mixed x86 and Arm (CAX) nodes
- Private-only clusters with a NAT router; Tailscale node transport; dual-stack with Cilium
View 5 more
- Optional Longhorn, cert-manager, Rancher and embedded registry mirror (Spegel)
- Hetzner Robot dedicated servers can join the cluster
- Plan-time validation that rejects invalid variable combinations before anything is created
- createkh script that writes kube.tf and builds the Leap Micro snapshots with Packer
- Agent skills for Claude Code, Codex and Cursor: configuration help, v2 to v3 migration, upgrades, node debugging
Limitations
Alternatives
The same job
These do what kube-hetzner does.
- hetzner-k3s The easiest and fastest way to create production-ready Kubernetes clusters on Hetzner Cloud
- kOps The easiest way to get a production grade Kubernetes cluster up and running
- Cluster API Provider Hetzner Manage Kubernetes clusters on Hetzner, fully declarative, Kubernetes-native and with self-healing
- Syself Autopilot Fully managed Kubernetes on your own Hetzner servers
- Edka Kubernetes platform in your own cloud account for apps, databases and agents
- Cloudfleet Managed Kubernetes from datacenter to cloud to edge
