A review of the whole tool, with the fixes: failures the commands used to hide, secrets in debug output and temporary files, Hetzner API paging, stricter configuration checks, and a spec suite that now runs in CI. All of it came in #819.
New
- Unknown keys in the configuration file are reported as warnings with their full path, for example
networking.ssh.use_ssh_agent is not a setting hetzner-k3s knows. A typo used to keep the default without a word. - CI runs the spec suite on pull requests and on pushes to
main. A release stops if a spec fails or the tag does not matchVERSION, and each release now shipshetzner-k3s-checksums.txtwith the SHA-256 of every binary. GITHUB_TOKEN, when set, is used to fetch the list of k3s releases. A failed refresh falls back to the list fetched before, so a GitHub rate limit no longer stops every command.
Fixes
Commands that hung or reported the wrong result
createwaited forever when a server did not come up or a node failed its setup. It now names the node, exits with status 1, and the next run carries on from there.runexited with 0 whatever the nodes answered, and broke on scripts that contained its here-document marker. Scripts are uploaded base64 encoded, the exit status of each node is read back, each node's output prints in one block, and the summary names the nodes that failed.deletewith no terminal waited for input. It stops and points at--force.- An unhandled error, a broken YAML file or a wrong config path printed a Crystal backtrace. Each is now a one-line error, with the trace behind
DEBUG=true.
Secrets
DEBUG=trueprinted the kubeconfig and the k3s token.- Kubeconfig copies were readable by other users before the final chmod, and the load balancer copy was never removed.
- The temporary script for local commands was created with mode 0755 under a predictable name.
Hetzner API
- Several list calls read only the first page of 25, so a project with more servers, networks, firewalls or placement groups got wrong answers. Every list call now reads all pages, and retries a failed page three times.
- Resource ids were 32-bit integers, which current Hetzner ids no longer fit.
- A 429 waited for the full rate limit reset, which can be an hour away. Each wait is capped at 60 seconds now.
Cluster setup
- An unreachable master was read as "no token yet", so
createmade up a new k3s token for a running cluster. It now stops and asks for the masters to be reachable. - A failed SSH check on an external node was read as "never set up", which re-ran the full setup on a node in service. It now stops instead.
- A master without a private network lost its provider ID when one metadata request failed. The request is retried and checked.
additional_pre_k3s_commandsentries that YAML reads as something other than a string made cloud-init drop the whole list. They are quoted now.- A pool whose name ended with another pool's name could get that pool's labels and taints.
- A slow managed CoreDNS rollout ended
create. deletenow removes the servers of an autoscaled pool that is no longer in the configuration, and only servers labelled as part of the cluster.- With a private network,
use_local_firewall: trueturned the Hetzner firewall off although the local firewall is never installed there, which left the nodes with no firewall. The WireGuard rule of the Hetzner firewall opened TCP instead of UDP. upgradeskipped pools with aNoExecutetaint, and upgraded no node at all when the masters had a taint of their own.- The etcd snapshot default
0.hourlywas not a cron expression, so clusters withoutsnapshot_schedule_cronnever took a scheduled snapshot. An S3 endpoint URL with a port lost the port.
Configuration checks
Firewall rule protocol, direction and ports, the node port range, pool locations, autoscaling bounds, taints, the SSH key with the agent and the autoscaler timings are checked before anything is created, each with a message that names the value.
Docs
Samples that put settings where the tool ignores them, wrong defaults and wrong unit names are corrected. A new spec parses every YAML sample in the docs and the README with the real models.
Upgrading
No configuration change is required: a configuration that works on 2.21.0 loads unchanged. Some clusters see a one-time change on the next create, and the upgrade notes list each case:
- k3s restarts on the masters (the first alone, then the others) if
datastore.etcdhas nosnapshot_schedule_cron, or if the S3 endpoint is written with a port. - A Hetzner firewall is created for clusters with a private network and
use_local_firewall: true. Add anything you serve on a public address tocustom_firewall_rulesfirst. - The autoscaler pod restarts once if an additional command contains
#. create,runanddeleteexit with 1 on failures they used to hide, so a pipeline that relied on the old 0 now stops.
The bundled addons (Cloud Controller Manager, CSI driver, Cluster Autoscaler, System Upgrade Controller) are unchanged since 2.21.0.
If hetzner-k3s is useful to you or your company, please consider sponsoring its development.
Sponsorship helps ensure continued maintenance and new features. Thank you to our current sponsors! 🙏