Pawel Wieczorek | 30e199a | 2020-07-16 16:15:06 +0200 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | Vagrant.configure("2") do |config| |
| 5 | |
| 6 | config.vm.provider :libvirt do |libvirt| |
| 7 | libvirt.default_prefix = "k8s_bin_versions_inspector"; |
| 8 | libvirt.driver = "kvm"; |
| 9 | libvirt.cpus = 6; |
| 10 | libvirt.memory = 12288; |
| 11 | end |
| 12 | |
| 13 | config.vm.box = "generic/ubuntu1804"; |
| 14 | config.vm.hostname = "k8s-bin-versions-inspector"; |
| 15 | config.vm.synced_folder ".", "/vagrant", disabled: true; |
| 16 | config.vm.synced_folder "..", "/home/vagrant/k8s_bin_versions_inspector", type: :sshfs; |
| 17 | |
| 18 | config.vm.provision "shell", inline: <<-end |
| 19 | export DEBIAN_FRONTEND=noninteractive &&\ |
| 20 | apt-get update &&\ |
| 21 | apt-get upgrade -y &&\ |
| 22 | apt-get dist-upgrade -y &&\ |
| 23 | apt-get install -y python3 python3-pip snap git vim net-tools htop &&\ |
| 24 | pip3 install --system -r /home/vagrant/k8s_bin_versions_inspector/env/requirements-dev.txt &&\ |
| 25 | snap install --classic microk8s &&\ |
| 26 | usermod -a -G microk8s vagrant |
| 27 | end |
| 28 | config.vm.provision :reload; |
| 29 | config.vm.provision "shell", privileged: false, inline: <<-end |
Pawel Wieczorek | 782390a | 2020-10-29 12:04:58 +0100 | [diff] [blame] | 30 | microk8s start &&\ |
| 31 | microk8s status --wait-ready &&\ |
Pawel Wieczorek | 30e199a | 2020-07-16 16:15:06 +0200 | [diff] [blame] | 32 | microk8s config > /home/vagrant/.kube/config &&\ |
| 33 | microk8s kubectl apply -f /home/vagrant/k8s_bin_versions_inspector/env/configuration |
| 34 | end |
| 35 | end |
| 36 | |