Lab setup of kubernetes cluster on baremetal using matchbox.
- At least two machines as cluster nodes, access to BIOS to change boot order
- Private network for cluster (switch or bridge can be used, some switches may require extra configuration)
- One Windows machine to boot cluster, with:
- VirtualBox
- Vagrant
- Python + jinja2 + wol for config generation and wake on lan
- 30-60 min depending on internet access speed
- Check private network, adjust boot order of nodes to boot from network first
- Often on power on NIC is turned off/on and that can be a problem with some switches, check that features like portfast are enabled on switch
(For cisco switches see
config/S1.txt
example configuration) - On Windows machine install required software
- Check that VirtualBox can create and run VMs (for example Hyper-V is disabled)
- Find MAC addresses of computers designated as cluster nodes (NIC used for private network)
- Edit
config.json
file: arrayhosts
should contain description of every host: mac address, name, designated ip address. By default ip addresses should be from 172.18.0.0 network. - Run
python scripts/make_config.py
to generate configs - Edit
build.cmd
to reflect your setup:- Change
S:
to letter of SSD drive or just useC:
- Change
CISCO
to name of your NIC used for private network
- Change
- Edit
Vagrantfile
:- Change
S:
again - Change
Realtek...
to physical name of NIC used for private network
- Change
- Run
build.cmd
, check network again and wait a while - Generate cluster certificates with
vagrant ssh
and/vagrant/scripts/tls/k8s-certgen
. Generate ssh keys withssh-keygen
and save tosshekeys_dir
stated inconfig.json
. - Run
run.bat
- Run
wake.cmd
, nodes should power on and start booting from network, process can take 10-15 min - Run
SET KUBECONFIG=%cd%\config\assets\tls\kubeconfig
andkubectl proxy
, now dashboard is available atlocalhost:8001