{"id":42761233,"url":"https://github.com/starwit/k3s-hetzner","last_synced_at":"2026-01-29T20:34:11.042Z","repository":{"id":187425005,"uuid":"655807156","full_name":"starwit/k3s-hetzner","owner":"starwit","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-23T15:50:41.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-01-23T16:56:16.968Z","etag":null,"topics":["infrastructure"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/starwit.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-06-19T16:29:35.000Z","updated_at":"2023-06-19T21:22:53.000Z","dependencies_parsed_at":"2023-08-10T10:45:06.692Z","dependency_job_id":"42b1a195-9329-402e-a9b0-fa7d3faae9d0","html_url":"https://github.com/starwit/k3s-hetzner","commit_stats":null,"previous_names":["starwit/k3s-hetzner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/starwit/k3s-hetzner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fk3s-hetzner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fk3s-hetzner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fk3s-hetzner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fk3s-hetzner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starwit","download_url":"https://codeload.github.com/starwit/k3s-hetzner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starwit%2Fk3s-hetzner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28884291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["infrastructure"],"created_at":"2026-01-29T20:34:10.345Z","updated_at":"2026-01-29T20:34:11.037Z","avatar_url":"https://github.com/starwit.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Terraform project to run a K3s server on Hetzner\n\n## How to setup a fully functional k3s, that is reachable via Tailscale\n\n1. Get Hetzner API token for the project you want to deploy the machine in (if not existing, please create one in Hetzner Cloud Console and add it to Bitwarden)\n2. Make sure that there is a SSH key in the same Hetzner project that you know the name of and have access to\n2. Generate Tailscale auth token\n    1. Go to https://login.tailscale.com/admin/settings/keys\n    2. Click \"Generate auth key\"\n        1. Enable \"pre-approved\" \n        2. Enable \"tags\" and assign tags \"k8s\" and \"ssh-server\"\n        3. Keep defaults for everything else\n3. Create `vars.tfvars` from `vars.tfvars.template` (do not change the template!)\n    1. Insert hetzner API token at `hcloud_token`\n    2. Adapt `env_name` (+ `server_type` and `location` if needed)\n    3. Insert Tailscale auth key at `tailscale_auth_key`\n    4. Insert ssh key name from Hetzner console at `ssh_key_name`\n4. Run `terraform plan` and if it succeeds run `terraform apply`\n    1. Take note of the server ip in the output\n5. You should now be able to connect to the machine via ssh using its public IP\n6. It takes a couple of minutes for everything to update, the machine to reboot, Tailscale to setup and K3s to install. After that, the following things should work\n    1. SSH connection should also be possible through tailscale (Tailscale name is `${env_name}-k3s`)\n    2. `curl ${env_name}-k3s` should return `404 page not found`\n7. Get Kubernetes config from the cluster\n    1. `scp ${env_name}-k3s:/etc/rancher/k3s/k3s.yaml ~/.kube/xyz.yaml`\n    2. Change `server: https://127.0.0.1:6443` entry to `server: https://${env_name}-k3s:6443`\n\n## General explanation\n\nThis project does:\n* update \u0026 upgrade\n* install and activate tailscale\n* install k3s\n* setup firewall to allow access via tailscale only\n\nYou have to provide the following params:\n* hcloud_token = \"Hetzner-Token\" - lets Terraform talk to Hetzner API\n* ssh_private_key = \"path/to/ssh/key\" - used to login into new servers\n* ssh_fingerprint = \"fingerprint\" - SSH key already present in your Hetzner project to be provisioned to new server\n* env_name = \"test1\" - how your box should be named\n* tailscale_api_key = \"key\" - Tailscale auth key, to add VPN to new server (see https://login.tailscale.com/admin/settings/keys; for a fully automated setup, you have to check \"pre-approved\" when creating the key)\n* base_domain = domain used for load balancer and certificates\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwit%2Fk3s-hetzner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarwit%2Fk3s-hetzner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarwit%2Fk3s-hetzner/lists"}