This setup allows to create a multi-node kubernetes cluster on an ESXi lab environment.
- ESXi host with free (ESXi) installed (https://my.vmware.com/en/web/vmware/evalcenter?p=free-esxi7)
- Vagrant host uses linux (centos in my case)
Make ssh available and configure ESXi passwordless access as described in WWW many times already ;-). Test with a Linux box first before you move on.
Important:
I use DHCP on the "VM Network" and configure static IP/MAC mappings
for all the uk8sxx hosts I defined in Vagrantfile.
DNS configuration hostname/upstream-DNS comes inherently with DHCP.
Issues I faced regarding mac addresses in ESXi:
ESXi uses 00:0C:29 as vendor prefix for ESXi.
In order to automate VM's I used 00:50:56 as
prefix pre-defined in Vagrantfile.
I installed ansible via python on the Vagrant host:
$ sudo python3 -m pip install pip --upgrade
$ sudo python3 -m pip install openshift
$ sudo python3 -m pip install ansible
$ ansible-galaxy collection install community.kubernetes
Install vagrant as describe at Hashicorp!
ESXi plug-in documentation: https://github.com/josenk/vagrant-vmware-esxi
Install plugin: vagrant plugin install vagrant-vmware-esxi
$ vagrant up |tee log.txt
These scripts are only meant to be used for testing purposes only ! Even if they strive to create a environement relatively representative of a production kubernetes cluster (with notably different roles on different nodes and the activation of RBAC), the cluster comes with default configuration and with no hardening whatsoever !