This project contains a CLI tool to easily provision kubernetes clusters on Hetzner Cloud.
This is my very first tool written in Go.
Get the linux binary from releases page.
Download version 0.2.1 - linux-amd64
or get it from source:
$ go get -u github.com/xetys/hetzner-kube
In your Hetzner Console generate an API token and
$ hetzner-kube context add my-project
Token: <PASTE-TOKEN-HERE>
Then you need to add an SSH key:
$ hetzner-kube ssh-key add -n my-key
This assumes, you already have a SSH keypair ~/.ssh/id_rsa
and ~/.ssh/id_rsa.pub
And finally you can create a cluster by running:
$ hetzner-kube cluster create --name my-cluster --ssh-key my-key
This will provision a brand new kubernetes cluster in latest version!
You can built high available clusters with hetzner-kube. Read the High availability Guide for further information.
You can install some addons to your cluster using the cluster addon
sub-command. Currently these are the supported first addons:
- helm
- Rook
- OpenEBS
- NGinx ingress controller (requires helm)
- cert-manager (requires helm)
- docker-registry (requires PVC)
Feel free to contribute cluster addons. You can simply create one by implementing the ClusterAddon
interface and
adding it to the addons.
If you like to run some scripts or install some additional packages while provisioning new servers you can use cloud-init
$ hetzner-kube cluster create --name my-cluster --nodes 3 --ssh-key my-key --cloud-init <PATH-TO-FILE>
An example file to make all nodes ansible ready. The comment on the first line is important:
#cloud-config
package_update: true
packages:
- python
This article guides through a full cluster setup.