Skip to main content

Terraform Configuration

This document provides details about the Terraform configuration for Kube-Hetzner.

Requirements

NameVersion
terraform>= 1.8.0
assert>= 0.16.0
github>= 6.4.0
hcloud>= 1.51.0
local>= 2.5.2
ssh2.7.0

Providers

NameVersion
cloudinitn/a
github>= 6.4.0
hcloud>= 1.51.0
local>= 2.5.2
nulln/a
randomn/a
ssh2.7.0

Modules

NameSourceVersion
agents./modules/hostn/a
control_planes./modules/hostn/a

Resources

The module creates the following resources in your Hetzner Cloud project:

Hetzner Cloud Resources

  • Firewall: Security groups for cluster access
  • Floating IPs: Optional floating IPs for egress traffic
  • Load Balancers: Control plane and agent load balancers
  • Network: Private network for cluster communication
  • Network Routes: Routing rules for the private network
  • Network Subnets: Subnets for different node types
  • Placement Groups: Anti-affinity groups for nodes
  • Primary IPs: Public IPs for NAT routers
  • Reverse DNS: DNS entries for your nodes
  • Servers: Control plane and agent nodes
  • SSH Keys: SSH keys for node access
  • Volumes: Optional volumes for storage

Local Resources

  • Files: Configuration files generated locally
  • Sensitive Files: Kubeconfig and other sensitive files
  • Null Resources: Provisioning and configuration triggers

Module Source

You can specify the module source in multiple ways:

module "kube-hetzner" {
source = "kube-hetzner/kube-hetzner/hcloud"
version = "2.15.3" # Optional but recommended
# ... other configuration
}

2. GitHub Repository

module "kube-hetzner" {
source = "github.com/kube-hetzner/terraform-hcloud-kube-hetzner"
# ... other configuration
}

3. Local Development

module "kube-hetzner" {
source = "../../kube-hetzner/" # Path to local git repo
# ... other configuration
}