HA k3s provisioning
This series is incomplete as of now. Each new post is written as I move along in my project and it might take a while between posts depending on how much “free time” I have outside of my day-to-day work.
A long time ago I wrote an (incomplete) post series about setting up k8s with the help of ansible and terraform on the UpCloud platform.
The world have moved forward quite a bit, and I have for a while been using hetzner cloud to host my development/staging cluster.
I write this series to give myself a bit of an incentive to actually complete both the series and the cluster setup, something
I have been postponing for quite a few years…
Disclaimer: I’m not affiliated with Hetzner or any other company which is referred to in this series.
My current cluster is manually provisioned and uses k3s (which is a slimmed down version of kubernetes), which works quite alright,
but it’s not HA and I would really prefer to be able to re-provision it easily (both the cluster itself and all resources running in it).
So, the new cluster I want to build should be automatically provisioned and modified via CI (GitLab), HA (3x master nodes) and for now, running on hetzner.
In the future, other providers could be added to make it multi-cloud, but I don’t need that right now.
The reason I go with hetzner for this, is because they have good and cheap shared vcpu instances with both AMD64 and ARM64 architecture.
Their API and terraform provider is great, and they are located in the EU, which is one of my requirements.
Further, if you require more power, they have dedicated cpu instances as well as bare metal machines.
Their other services covers most of the standard stuff you would want from a budget cloud provider.
So, what are my plans?
Well, I’m quite fond of terraform, so that is what I will be using to provision the VM:s in hetzner.
The software on the machines should as well be automatically installed, but in this case I’m less sure.
I’m most comfortable with Ansible when it comes to that, so It will most likely be the tool of choice.
This post will be updated with links to all the posts of the project, and I’ll try to make as much open source as possible.
- 1 - HA k3s provisioning
- 2 - HA k3s - Networking in Hetzner
To get the most out of this series, you should have some fundamental understanding on how terraform and ansible works,
as well as an account at Hetzner for doing laborations.
You can always bring down the cluster with a terraform destroy
at any time, so costs can be cut quite low if you don’t have a promo code.
If you wish to use my promo code (gives $20 in free credits and if you decide to keep on using hetzner it will give me some credits too), feel free to use the following link for signup: Referral link! (make sure you read the terms before signing up).