Adding detailed steps to get vagrant working with libvirt

This commit is contained in:
NitinAtIntel
2019-08-06 23:42:47 -07:00
committed by Ganesh Maharaj Mahalingam
parent 10307fde45
commit 5c4de21fe7
+28 -2
View File
@@ -7,8 +7,28 @@ This setup currently will work with k8s 1.14 & above. Any version of k8s before
To be able to test this tool, you can create a 3-node vagrant setup. In this tutorial, we will talk about using [libvirt](https://github.com/vagrant-libvirt/vagrant-libvirt), but you can use any hypervisor that you are familiar with.
* Install vagrant on the distro you are using. Steps can be found at [Vagrant docs](https://www.vagrantup.com/intro/getting-started/install.html#installing-vagrant)
* `vagrant up --provider=libvirt`
## Install vagrant on Ubuntu
On Ubuntu Bionic, run these commands
Install dependencies and prepare system
```bash
sudo apt-get update
sudo apt-get install gcc make
sudo apt-get install qemu qemu-kvm libvirt-bin ebtables dnsmasq-base virt-top libguestfs-tools virtinst bridge-utils
sudo apt-get install libxslt-dev libxml2-dev libvirt-dev zlib1g-dev ruby-dev
sudo modprobe vhost_net
sudo lsmod | grep vhost
echo "vhost_net" | sudo tee -a /etc/modules
```
Download the latest Debian package from https://www.vagrantup.com/downloads.html and install it followed by vagrant-libvirt
```bash
sudo dpkg -i vagrant_${VER}_x86_64.deb
sudo vagrant plugin install vagrant-libvirt
```
Run vagrant
```bash
sudo vagrant up --provider=libvirt
```
Now you have a 3 node cluster up and running. Each of them have 2 vCPU, 4GB Memory, 2x10GB disks, 1 additional private network.
Customize the setup using environment variables. E.g., `NODES=1 MEMORY=8192 CPUS=8 vagrant up --provider=libvirt`
@@ -20,6 +40,12 @@ vagrant ssh clr-01
cd clr-k8s-examples
```
Note, vagrant installation steps were derived from:
* https://computingforgeeks.com/install-kvm-centos-rhel-ubuntu-debian-sles-arch/
* https://computingforgeeks.com/using-vagrant-with-libvirt-on-linux/
* https://computingforgeeks.com/install-latest-vagrant-on-ubuntu-18-04-debian-9-kali-linux/
* https://github.com/vagrant-libvirt/vagrant-libvirt/blob/master/README.md
## Setup the nodes in the cluster
Run [`setup_system.sh`](setup_system.sh) once on each and every node (master and workers)