{"id":22071762,"url":"https://github.com/mhutter/terraform-k3s-hcloud","last_synced_at":"2025-10-11T18:30:53.321Z","repository":{"id":203969239,"uuid":"710808624","full_name":"mhutter/terraform-k3s-hcloud","owner":"mhutter","description":"K3s on CoreOS on ARM on Hetzner Cloud","archived":false,"fork":false,"pushed_at":"2024-11-21T17:00:27.000Z","size":69,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-30T20:35:41.175Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhutter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-27T13:37:32.000Z","updated_at":"2024-09-24T07:49:01.000Z","dependencies_parsed_at":"2024-05-22T02:40:03.094Z","dependency_job_id":"e004c5d6-3c47-472a-b482-86621759ae7d","html_url":"https://github.com/mhutter/terraform-k3s-hcloud","commit_stats":null,"previous_names":["mhutter/terraform-k3s-hcloud"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhutter%2Fterraform-k3s-hcloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhutter%2Fterraform-k3s-hcloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhutter%2Fterraform-k3s-hcloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhutter%2Fterraform-k3s-hcloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhutter","download_url":"https://codeload.github.com/mhutter/terraform-k3s-hcloud/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236118313,"owners_count":19097683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T20:33:54.507Z","updated_at":"2025-10-11T18:30:48.008Z","avatar_url":"https://github.com/mhutter.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# K3s on CoreOS on ARM on Hetzner Cloud\n\nDeploy a K3s cluster on Hetzner cloud.\n\n\n## Features\n\n- Single control plane \"controller\" (or \"server\" in K3s lingo)\n- All cluster traffic via internal network\n- Automated installation of K3s on all systems\n- Cluster bootstrapping\n- Nodes automatically join the cluster\n- Controller \u0026 Nodes can be replace\n\n\n### Non-Goals\n\n- HA control plane\n\n\n## Backlog\n\n- [ ] Configure node flavors\n- [ ] Support x86 nodes\n\n\n## Setup\n\nFor configuration, set\n\n```sh\nexport KUBECONFIG=\"${PWD}/.kubeconfig\"\n\n# Used for SSH \u0026 Kubernetes API access to the controller\nexport TF_VAR_admin_cidrs='[\"1.2.3.4/32\"]'\n\n# Terraform State\nexport AWS_ACCESS_KEY_ID=''\nexport AWS_SECRET_ACCESS_KEY=''\nexport AWS_S3_ENDPOINT=''\n\n# Provider config\nexport TF_VAR_hcloud_token_dev=''\nexport TF_VAR_hcloud_token_prod=''\n```\n\nSet up OpenTofu:\n\n```sh\ntofu init\ntofu workspace select dev  # or `prod`\n```\n\nAnd then, `just` do all the things:\n\n```sh\njust plan\njust apply\n\n# wait a minute until K3s is installed \u0026 ready\njust kubeconfig\n# (repeat if failed)\n\njust install-cilium\n```\n\nAnd that should result in a K3s cluster with three nodes, ready to go!\n\n\nNOTE: The CoreOS autoupdater expects [poseidon/fleetlock](https://github.com/poseidon/fleetlock) to run on the cluster, using `10.43.0.15` as the Service IP (configure via `fleetlock_url` TF var).\n\n\n## Day two operations\n\n### Replacing the controller\n\nThe Controller can just be replaced at any time. All data is persisted onto an external disk. To be on the safe side, stop the `k3s` service on the Controller before shutting it down.\n\n\n### Replacing a node\n\nTo gracefully replace a node, follow these steps:\n\n1. Let OpenTofu forget the server: `tofu state rm 'hcloud_server.node[N]` where `N` is any of the servers\n1. Provision a new node: `just plan`, `just apply`\n1. Once the new node is ready, drain the old one.\n1. Manually delete the old server and `kubectl delete node` it from the cluster.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhutter%2Fterraform-k3s-hcloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhutter%2Fterraform-k3s-hcloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhutter%2Fterraform-k3s-hcloud/lists"}