aboutsummaryrefslogtreecommitdiffstats
path: root/test/security/check_versions/env/Vagrantfile
blob: 9753a74ad999f222446d398fb4171ebf9faccd2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
	
	config.vm.provider :libvirt do |libvirt|
		libvirt.default_prefix = "k8s_bin_versions_inspector";
		libvirt.driver         = "kvm";
		libvirt.cpus           = 6;
		libvirt.memory         = 12288;
	end
	
	config.vm.box = "generic/ubuntu1804";
	config.vm.hostname = "k8s-bin-versions-inspector";
	config.vm.synced_folder ".",  "/vagrant", disabled: true;
	config.vm.synced_folder "..", "/home/vagrant/k8s_bin_versions_inspector", type: :sshfs;
	
	config.vm.provision "shell", inline: <<-end
		export DEBIAN_FRONTEND=noninteractive &&\
		apt-get update &&\
		apt-get upgrade -y &&\
		apt-get dist-upgrade -y &&\
		apt-get install -y python3 python3-pip snap git vim net-tools htop &&\
		pip3 install --system -r /home/vagrant/k8s_bin_versions_inspector/env/requirements-dev.txt &&\
		snap install --classic microk8s &&\
		usermod -a -G microk8s vagrant
	end
	config.vm.provision :reload;
	config.vm.provision "shell", privileged: false, inline: <<-end
		microk8s start &&\
		microk8s status --wait-ready &&\
		microk8s config > /home/vagrant/.kube/config &&\
		microk8s kubectl apply -f /home/vagrant/k8s_bin_versions_inspector/env/configuration
	end
end