Automates the installation of K3s Kubernetes cluster on ProxMox
docker run -p [port]:80 -v /path/to/your/.ssh:/root/.ssh:ro -d --name kiop idemery/kiop:alpha
Example:
docker run -p 8080:80 -v /home/idemery/.ssh:/root/.ssh:ro -d --name kiop idemery/kiop:alpha
Open your browser on http://localhost:8080 and fill in the information then click submit. Wait and watch the console screen on bottom.
By mapping your ssh key folder to this container (notice the read only :ro ), this application does the following in order:
- Connects to your ProxMox server using SSH session with IP, username and password
- Downloads a linux cloud image (suggested is ubuntu focal minimal cloud image)
- Uploads your public ssh key to the ProxMox server
- Creates virtual machine template based on the cloud image and sets the ssh key cloud-init parameter to your ssh key
- Creates master and worker nodes by cloning the template based on the count of master and worker IPs entered and sets the network configuration and disk size using cloud-init parameters
- Copies and configures ansible/inventory/sample/hosts.ini and ansible/inventory/sample/group_vars/all.yml into my-cluster folder
- Executes ansible-playbook process
- Used .NET Core 6:latest docker image because its based on debian which is easy to install ansible on (thanks to geerlingguy's repo mentioned below)
- Installed ssh package to be able to connect to the ProxMox server, issue commands, and upload user's public ssh key
- For ansible to be able to connect to the VMs I referenced the private ssh key of the user in /etc/ansible/ansible.cfg and used host_key_checking = False and private_key_file = /root/.ssh/id_rsa (see the Dockerfile)
- Used Blazor framework to automatically get status from server without worrying about the underlying web sockets and SignalR implementation
Thanks to all the following GitHub repositories
