A simple collection of scripts for bootstrapping a simply k8s cluster on Hetzner Cloud.
You'll need:
Create a kubernetes cluster with 2 CX21 nodes:
$ export HCLOUD_TOKEN=<api token>
$ ./hcloud_kube -t cx21 -n 2
-
Create a new project
-
Create a new API token in the project
-
Create a local environment variable
HCLOUD_TOKEN
with the value of the token.$ export HCLOUD_TOKEN=<api token>
-
Run the hcloud script
$ ./hcloud_kube
-
You can then copy the kube admin config
$ cp /tmp/hcloud_kube/admin.conf ~/.kube/config
-
You probably also want to save the generated ssh keys (in case you want to ssh in later)
$ cp /tmp/hcloud_kube/provision_key* ~
Command line options
-
-t TYPE
(default:cx21
)The hetzner instance type for each node.
-
-n COUNT
(default:0
)The number of hetzner workers to provision.
If set to 0, the master node is tainted to accept pods.
For additional configuration, dive in, and edit the script - it's meant to be built upon.
https://community.hetzner.com/tutorials/install-kubernetes-cluster
Because this tool is short and sweet, it is hereby released into the public domain. Do whatever you want.