Features:
- Provision a bare metal Kubernetes cluster automatically
- Automatically delete and re-provision the cluster, including re-installing the OS on all nodes
- Persistent storage external to Kubernetes
- Configure a network
One server runs automation to reinstall nodes' operating systems and install Kubernetes. This server also provides persistent storage to Kubernetes such that deleting the cluster does not lose your data. The automation is designed to destroy the cluster and re-create it from scratch each time, ensuring it's easy to fix. This was set up with the Kubernetes developer or tinkerer in mind - ease of use and minimal complexity is preferred.
- One EdgeOS router
- Two or more AMD64 computers
- Enough cabling or additional networking equipment to connect all the computers (e.g. one ethernet switch, one cable to connect the switch to the router, and an additional cable for each computer)
- Know how to reconfigure boot order
Back up all data you care about. This automation includes a feature to automatically and remotely reinstall operating systems. This should only happen to computers in the datacenter network that are booted from the network.
- Install Ubuntu 18.04 on one of the computers
- Clone this repository
- Assume all following software steps use this environment
All the computers should be in the same Layer 2 network and that network should be plugged into the EdgeOS router on eth1. The EdgeOS router's eth2 port should be plugged into the internet (e.g. your modem). The eth0 port can be plugged into your home network router (wifi).
Example:
- Connect all computers to the same switch (ethernet), including the machine you installed Ubuntu on
- Connect the switch to the EdgeOS router on eth1
- Unplug your wifi router from your modem
- Connect the EdgeOS router's eth2 to your modem
- Connect the EdgeOS router's eth0 to your home wifi (optional to restore home network)
- For all computers other than the one you installed Ubuntu on, configure the network as first in the boot order
From the root of this repository, run this script
./init
Store your data at /data on the Ubuntu server, it is the only thing designed not to be erased when the script is re-run. You are still responsible for your own data.
Just run the script again.
The following tools are used:
- Host discovery (dynamic inventory, nmap)
- Configure network (EdgeOS)
- Deploy and update operating systems (Container Linux, PXE network booting)
- Kubernetes (k3s)
- Kubernetes-external persistent storage (NFS using geerlingguy's role)
If you are looking for some applications to install, feel free to use my applications