Setup - Hetzner Bare Metal
Setting up a Kubernetes Cluster with Hetzner Dedicated Servers
This guide for Hetzner Bare Metal is WIP and not currently recommended. Proceed with caution until an update is released and this warning removed.
Checkout the repository source to manage a cluster of dedicated servers on Hetzner.
The scripts in this repository will set up and maintain one or more kubernetes clusters consisting of dedicated Hetzner servers. Each cluster will also be provisioned to operate as a node in the MAYACHain network.
Executing the scripts in combination with some manual procedures will get you highly available, secure clusters with the following features on bare metal.
Preparations
Servers
Acquire a couple of servers as the basis for a cluster (AX41-NVME
's are working well, for instance). Visit the admin panel and name the servers appropriately.
Refer to the reset procedure to initialize them properly.
vSwitch
Create a vSwitch and order an appropriate subnet (it may take a while to show up after the order). Give the vSwitch a name (i.e. ma-k8s-net
) and assign this vSwitch to the servers.
Check out the docs for help.
Usage
Clone this repository cd
into it and download kubespray.
Create a Python virtual environment or similar.
Install dependencies required by Python and Ansible Glaxy.
Note: Mitogen does not work with ansible collections and the strategy must be changed (i.e.
strategy: linear
).
Provisioning
Create a deployment environment inventory file for each cluster you want to manage.
Edit the inventory file with your server ip's and network information and customize everything to your needs.
Check this out for more playbooks on cluster management.
MAYAChain
For the cluster to operate as a node in the MAYACHain network, deploy as instructed here. You can also refer to the node-launcher repository, if necessary, or the MAYAChain documentation as a whole.
Resetting the bare metal servers
This will install and use Ubuntu 20.04 on only one of the two internal NVMe drives. The unused ones will be used for persistent storage with ceph/rook. You can check the internal drive setup with lsblk
. Change it accordingly in the command shown above when necessary.
Manually
Visit the console and put each server of the cluster into rescue mode. Then execute the following script.
Automatically
Create a pristine state by running the playbooks in sequence.
Instantiation
Instantiate the servers.
Last updated