From 5c4de21fe7fe9543f8f9d7f319cccdfd56ab93c8 Mon Sep 17 00:00:00 2001 From: NitinAtIntel Date: Tue, 6 Aug 2019 23:42:47 -0700 Subject: [PATCH] Adding detailed steps to get vagrant working with libvirt --- clr-k8s-examples/README.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/clr-k8s-examples/README.md b/clr-k8s-examples/README.md index d645cca..5f876c2 100644 --- a/clr-k8s-examples/README.md +++ b/clr-k8s-examples/README.md @@ -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)