TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

I rewrote in Crystal my tool to quickly create Kubernetes clusters in Hetzner

127 pointsby SkyLinxover 2 years ago
Hi all, I just released a new version of <a href="https:&#x2F;&#x2F;github.com&#x2F;vitobotta&#x2F;hetzner-k3s">https:&#x2F;&#x2F;github.com&#x2F;vitobotta&#x2F;hetzner-k3s</a> that is a complete rewrite in Crystal that is faster, better overall and allows me to offer simple standalone executables. The previous version was written in Ruby, so users had to either set up a Ruby environment, or use a Docker image instead. This is no longer necessary.<p>This is my first project in Crystal and I love it already! It&#x27;s syntax is lovely - similar to Ruby&#x27;s - and it&#x27;s FAST!<p>I would appreciate any feedback anyone might have - if you are a Kubernetes user as well as a Hetzner customer, please give it a try and let me know what you think, if you encounter any issues etc.<p>During my tests I was able to create a cluster with highly available control plane (3 masters behind a load balancer) and 5 nodes in multiple regions in just *3 minutes*. This is the total time to create the resources (servers, firewall, load balancer, private network), deploy Kubernetes to all the nodes, install some stuff required to provision load balancers and persistent volumes out of the box, and install an upgrade controller to easily upgrade the Kubernetes version (I use k3s as Kubernetes distro). I don&#x27;t think there is a faster way to create a production Kubernetes cluster!<p>Do you have Kubernetes clusters in Hetzner already? If yes, which tool did you use to create them? Would be interested to know more about alternatives people are using.

11 comments

wg0over 2 years ago
Cannot stop myself from commenting because it has everything of my interest. Kubernrtes, Hetzner and Crystal.<p>Another kubernetes installer. I think there&#x27;s one Kubematic or similar already for Hetzner.<p>I&#x27;m going to try this and be possibly contribute back.<p>Few questions:<p>Why k3s why not k0s? What about cluster upgrades? Are they covered?<p>I&#x27;m probably going to setup a staging environment but can anyone suggest me a good CI&#x2F;CD for Kubernetes? How about GitHub actions?<p>Secondly, I need to run databases lots of them some in range of 500 GB or so and backup&#x2F;restore is important. Any suggestions there?
评论 #34197682 未加载
xrendanover 2 years ago
I have a cluster using terraform-hcloud-kube-hetzner [0] and I&#x27;m quite happy with it.<p>It uses MicroOS for rolling releases and auto-upgrades for less maintenance. I&#x27;m quite happy with it so far, and I like that it integrates with terraform.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;kube-hetzner&#x2F;terraform-hcloud-kube-hetzner">https:&#x2F;&#x2F;github.com&#x2F;kube-hetzner&#x2F;terraform-hcloud-kube-hetzne...</a>
评论 #34186179 未加载
评论 #34194490 未加载
评论 #34186239 未加载
gerwimover 2 years ago
Looks great! I see your tool uses Hetzner block volumes for storage. How do you manage your data backups (as Hetzner does not offer anything for their block storage volumes as far as I know).<p>My current setup is also on Hetzner. 1 master and 3 worker nodes. Managed by Rancher and I use Longhorn (also from Rancher Labs) for storage. It runs stable for two years now. But looking for a simpler solution, so I looked into k3s and k0s last week -- will also look into your tool ;-).
评论 #34190328 未加载
SOLAR_FIELDSover 2 years ago
Just as a point of reference, for me to spin up a 3 node cluster in terraform with GKE it takes 10+ minutes.
评论 #34186406 未加载
preisschildover 2 years ago
&gt; Do you have Kubernetes clusters in Hetzner already? If yes, which tool did you use to create them? Would be interested to know more about alternatives people are using.<p>Yes. I use ClusterAPI[1] with the cluster-api-provider-hetzner[2] &amp; Talos[3] (and Talos&#x27; cluster-api components) for that.<p>[1]: <a href="https:&#x2F;&#x2F;cluster-api.sigs.k8s.io&#x2F;user&#x2F;quick-start.html" rel="nofollow">https:&#x2F;&#x2F;cluster-api.sigs.k8s.io&#x2F;user&#x2F;quick-start.html</a><p>[2]: <a href="https:&#x2F;&#x2F;github.com&#x2F;syself&#x2F;cluster-api-provider-hetzner">https:&#x2F;&#x2F;github.com&#x2F;syself&#x2F;cluster-api-provider-hetzner</a><p>[3]: <a href="https:&#x2F;&#x2F;talos.dev" rel="nofollow">https:&#x2F;&#x2F;talos.dev</a>
scary-sizeover 2 years ago
Sweet! I have no interest in Kubernetes, but this lead me to give Crystal a try. Feels solid so far, nice standard lib for the usual things (json, http etc.). Compiler warnings helped find errors quickly. The language documentation reads very easily. And best of all: standalone executables.
评论 #34189751 未加载
评论 #34190294 未加载
eurgover 2 years ago
Hetzner has some attractively priced dedicated servers - for some heavier workloads that might be nice. Do they use a very different management API? (They have a cancellation period of &quot;30 days to the end of the month&quot;, which would complicate matters.)
评论 #34186374 未加载
评论 #34186437 未加载
speedgooseover 2 years ago
I have a development kubernetes cluster on hetzner. I used Ansible and K3S.<p>The most challenging part to me is setting up the disk encryption using LUKS, it requires a few manual steps.
hbienover 2 years ago
Great job! How were you able to do a stand-alone binary for Mac? I was able to for Linux via their Alpine&#x2F;MUSL image, but never figured out how to for Mac.
评论 #34186416 未加载
mathverseover 2 years ago
Love it! Have you tried to create a k8s operator in Crystal?
评论 #34186393 未加载
sureglymopover 2 years ago
If I&#x27;m allowed to ask.. what&#x27;s Crystal?
评论 #34190336 未加载
评论 #34189915 未加载