Getting started¶
This page walks a cluster owner through the one-time setup.
Prerequisites¶
You need:
- a Hetzner API token with
ReadandWriteon the project you want to use - a Cloudflare R2 bucket and an R2 API token with read+write
- a domain on Cloudflare you control, plus a Cloudflare API token with DNS Read and DNS Write on that zone, and the zone's ID (do not mistake it for the account ID often visible in the URL!)
Initial setup (cluster owner, once)¶
-
Install tools.
Most distributions do not package all of these directly. Use each project's official install instructions:
- Terraform and Terragrunt (HashiCorp / Gruntwork download pages)
- AWS CLI v2
- Packer and the hcloud CLI
jqandhcl2jsonfrom your distro package manager (orhcl2jsonfrom its releases)
-
Set R2 details in
infra/root.hcl:r2_account_id_default,r2_bucket_default,r2_aws_profile_default. These apply to every environment unless anenv.hcloverrides them. -
Configure the AWS profile in
~/.aws/credentialsusing the name fromr2_aws_profile_default. -
Set
cloudflare.zone_idandcloudflare.domainininfra/dev/env.hclfor the domain this environment should manage. -
Set
cert_manager.acme_emailininfra/dev/env.hclto the email address to use for Let's Encrypt certificates. -
Bootstrap the environment (this will generate the cluster SSH key, ask for Hetzner + Cloudflare tokens, upload
secrets.jsonto R2, and build the kube-hetzner MicroOS snapshot via packer if one isn't already present in the Hetzner project). -
Apply.
-
Fetch the kubeconfig from R2.
For the mental model behind bootstrap, R2, and the fetch scripts, see Secrets and helper scripts.
Timing
Bootstrap takes ~5–10 min on first run (packer builds the MicroOS snapshot). Apply itself is then ~5–10 min.
Share with teammates: the AWS profile keys (via password manager).
Next steps¶
To invite someone onto the cluster, send them to Joining as a teammate. To create another environment, see Adding environments. For the full Terragrunt/module dependency map, read How it fits together.
If something went wrong during the first apply, Troubleshooting collects the common failures and their fixes.