Production Kubernetes on Hetzner Cloud

Fully automated Kubernetes cluster deployment on Hetzner Cloud with GitOps, monitoring, and European compliance.

kuberneteshetznergitopsterraformeuropean-sovereignty

Overview

A production-ready Kubernetes setup on Hetzner Cloud infrastructure, providing a cost-effective European alternative to managed Kubernetes services while maintaining enterprise-grade features.

Why Hetzner?

  • Cost: 60% cheaper than EU managed Kubernetes
  • Performance: Excellent network and compute
  • Location: German data centers
  • Simplicity: Straightforward pricing and APIs

Architecture

Cluster Components

  • Control Plane: 3 dedicated nodes (HA setup)
  • Worker Nodes: Auto-scaling pool (3-10 nodes)
  • Load Balancer: Hetzner Load Balancer
  • Storage: Hetzner Volumes (CSI driver)
  • Networking: Cilium CNI

Infrastructure as Code

# Terraform configuration
module "k8s_cluster" {
  source = "./modules/hetzner-k8s"

  cluster_name = "prod-eu"
  location = "fsn1" # Falkenstein, Germany

  control_plane = {
    count = 3
    server_type = "cpx31"
    image = "ubuntu-22.04"
  }

  worker_pool = {
    min_nodes = 3
    max_nodes = 10
    server_type = "cpx21"
  }

  enable_monitoring = true
  enable_backups = true
}

Key Features

1. GitOps with ArgoCD

All applications deployed through Git:

# Application definition
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: web-app
spec:
  project: default
  source:
    repoURL: https://github.com/org/manifests
    path: apps/web
    targetRevision: main
  destination:
    server: https://kubernetes.default.svc
    namespace: production
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

2. Complete Observability

  • Metrics: Prometheus + Grafana
  • Logs: Loki
  • Traces: Tempo
  • Alerts: AlertManager

3. Security

  • Network Policies: Zero-trust networking
  • Pod Security: Enforced pod security standards
  • Secrets: External Secrets Operator
  • RBAC: Least privilege access

Deployment

Fully automated with Terraform and Ansible:

# 1. Deploy infrastructure
terraform apply

# 2. Bootstrap cluster
ansible-playbook playbooks/k8s-setup.yml

# 3. Install core components
kubectl apply -k clusters/production/

# 4. Deploy applications via GitOps
argocd app create apps --repo https://github.com/org/apps

Cost Comparison

Monthly costs for 6-node cluster:

ProviderCost
Hetzner€140
AWS EKS€420
GCP GKE€380
Azure AKS€350

Savings: 60-70%

Performance

  • Pod startup: Less than 5 seconds
  • Deployment time: Around 30 seconds
  • Node replacement: Under 2 minutes
  • Cluster recovery: Under 5 minutes

Use Cases

Perfect for:

  • Startups needing European hosting
  • Compliance-focused organizations
  • Cost-sensitive workloads
  • Development and staging environments

Limitations

  • No managed control plane
  • Manual upgrades required
  • Self-managed monitoring
  • Requires Kubernetes expertise

Conclusion

Hetzner Cloud provides an excellent foundation for Kubernetes clusters with significant cost savings while keeping data in European data centers.

Want the setup scripts? Check the GitHub repo