|
|
|
@ -10,13 +10,14 @@ Vagrant.configure("2") do |config|
|
|
|
|
|
config.vagrant.plugins = { |
|
|
|
|
'vagrant-k3s' => {:version => '~> 0.1.3'}, |
|
|
|
|
} |
|
|
|
|
config.vm.box = "fedora/35-cloud-base" |
|
|
|
|
config.vm.box = "generic/fedora37" |
|
|
|
|
config.vm.boot_timeout = ENV['TEST_VM_BOOT_TIMEOUT'] || 600 # seconds |
|
|
|
|
config.vm.synced_folder '../../../../dist/artifacts', '/vagrant', type: 'rsync', disabled: false, |
|
|
|
|
rsync__exclude: ENV['RSYNC_EXCLUDE'] || '*.tar.*' |
|
|
|
|
|
|
|
|
|
config.vm.define 'cgroup-unified', primary: true do |test| |
|
|
|
|
test.vm.hostname = 'smoke' |
|
|
|
|
test.vm.provision "disable-firewall", type: "shell", inline: "systemctl stop firewalld && systemctl disable firewalld" |
|
|
|
|
test.vm.provision :file, run: 'always', source: ENV['TEST_UNITFILE_ROOTFULL'], destination: 'k3s-rootfull.service' |
|
|
|
|
test.vm.provision :file, run: 'always', source: ENV['TEST_UNITFILE_ROOTLESS'], destination: 'k3s-rootless.service' |
|
|
|
|
test.vm.provision 'k3s-prepare', type: "shell", run: ENV['CI'] == 'true' ? 'never' : 'once', privileged: true do |sh| |
|
|
|
@ -36,9 +37,11 @@ Vagrant.configure("2") do |config|
|
|
|
|
|
systemctl daemon-reload |
|
|
|
|
|
|
|
|
|
# Install sonobuoy binary |
|
|
|
|
curl -fsSL https://github.com/vmware-tanzu/sonobuoy/releases/download/v0.20.0/sonobuoy_0.20.0_linux_amd64.tar.gz | tar xzvC /usr/local/bin sonobuoy |
|
|
|
|
SONOBUOY_VER=0.56.15 |
|
|
|
|
curl -fsSL https://github.com/vmware-tanzu/sonobuoy/releases/download/v"$SONOBUOY_VER"/sonobuoy_"$SONOBUOY_VER"_linux_amd64.tar.gz | tar xzvC /usr/local/bin sonobuoy |
|
|
|
|
|
|
|
|
|
# [Rootless] Configure sysctl |
|
|
|
|
dnf install -y fuse-overlayfs fuse |
|
|
|
|
echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/rootless.conf |
|
|
|
|
sysctl --system |
|
|
|
|
# [Rootless] Enable cgroup v2 delegation |
|
|
|
@ -47,6 +50,7 @@ Vagrant.configure("2") do |config|
|
|
|
|
|
[Service] |
|
|
|
|
Delegate=yes |
|
|
|
|
EOF |
|
|
|
|
|
|
|
|
|
systemctl daemon-reload |
|
|
|
|
|
|
|
|
|
# [Rootless] Enable systemd lingering |
|
|
|
@ -58,6 +62,7 @@ EOF
|
|
|
|
|
chown -R vagrant:vagrant /home/vagrant/.config |
|
|
|
|
SHELL |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
test.vm.provision 'k3s-install', type: 'k3s', run: ENV['CI'] == 'true' ? 'never' : 'once' do |k3s| |
|
|
|
|
k3s.args = %w[server] |
|
|
|
|
k3s.env = %w[INSTALL_K3S_NAME=server INSTALL_K3S_SKIP_DOWNLOAD=true K3S_TOKEN=vagrant INSTALL_K3S_SKIP_ENABLE=true] |