diff --git a/.github/workflows/install.yaml b/.github/workflows/install.yaml index d93db9109a7..83758a361b2 100644 --- a/.github/workflows/install.yaml +++ b/.github/workflows/install.yaml @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false matrix: - vm: [centos-9, rocky-8, rocky-9, fedora, opensuse-leap, ubuntu-2404] + vm: [centos-9, alma-10, rocky-9, fedora, opensuse-leap, ubuntu-2404] max-parallel: 3 defaults: run: @@ -77,50 +77,12 @@ jobs: path: tests/install/${{ matrix.vm }} - name: "Vagrant Up" run: vagrant up --no-tty --no-provision - - name: "Upload k3s binary to VM" + - name: "Prepare K3s binary" run: | chmod +x k3s vagrant scp k3s /tmp/k3s vagrant ssh -c "sudo mv /tmp/k3s /usr/local/bin/k3s" - vagrant provision --provision-with=k3s-upload - - name: Add binary to PATH - if: matrix.vm == 'centos-9' || matrix.vm == 'rocky-8' || matrix.vm == 'rocky-9' || matrix.vm == 'opensuse-leap' - run: vagrant provision --provision-with=add-bin-path - - name: "⏩ Install K3s" - run: | - vagrant provision --provision-with=k3s-prepare - vagrant provision --provision-with=k3s-install - if [ ${{ matrix.vm }} = 'opensuse-microos' ]; then vagrant reload --no-provision; fi - - name: "⏳ Node" - run: vagrant provision --provision-with=k3s-wait-for-node - - name: "⏳ CoreDNS" - run: vagrant provision --provision-with=k3s-wait-for-coredns - - name: "⏳ Local Storage" - run: vagrant provision --provision-with=k3s-wait-for-local-storage - continue-on-error: true - - name: "⏳ Metrics Server" - run: vagrant provision --provision-with=k3s-wait-for-metrics-server - continue-on-error: true - - name: "⏳ Traefik" - run: vagrant provision --provision-with=k3s-wait-for-traefik - continue-on-error: true - - name: "k3s-status" - run: vagrant provision --provision-with=k3s-status - - name: "k3s-procps" - run: vagrant provision --provision-with=k3s-procps - - name: "k3s-mount-directory" - run: vagrant provision --provision-with=k3s-mount-directory - - name: "k3s-uninstall" - run: vagrant provision --provision-with=k3s-uninstall - - name: "k3s-check-mount" - run: vagrant provision --provision-with=k3s-check-mount - - name: "k3s-unmount-dir" - run: vagrant provision --provision-with=k3s-unmount-dir + - name: Run K3s Install Test + run: vagrant provision - name: Cleanup VM run: vagrant destroy -f - - name: On Failure, launch debug session - uses: lhotari/action-upterm@v1 - if: ${{ failure() }} - with: - ## If no one connects after 5 minutes, shut down server. - wait-timeout-minutes: 5 diff --git a/.github/workflows/nightly-install.yaml b/.github/workflows/nightly-install.yaml index 8c778a1cf20..cff33f0971a 100644 --- a/.github/workflows/nightly-install.yaml +++ b/.github/workflows/nightly-install.yaml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: channel: [stable, latest] - vm: [rocky-9, fedora, opensuse-leap, ubuntu-2404] + vm: [alma-10, fedora, opensuse-leap, ubuntu-2404] max-parallel: 4 defaults: run: diff --git a/tests/install/alma-10/Vagrantfile b/tests/install/alma-10/Vagrantfile new file mode 100644 index 00000000000..a8f28806ee4 --- /dev/null +++ b/tests/install/alma-10/Vagrantfile @@ -0,0 +1,72 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +# + +ENV['TEST_INSTALL_SH'] ||= '../../../install.sh' +ENV['INSTALL_K3S_CHANNEL'] ||= 'latest' + +Vagrant.configure("2") do |config| + config.vagrant.plugins = ["vagrant-k3s"] + config.vm.box = "almalinux/10" + config.vm.boot_timeout = ENV['TEST_VM_BOOT_TIMEOUT'] || 600 # seconds + config.vm.synced_folder '.', '/vagrant', disabled: true + + # Load in helper functions + load "../install_util.rb" + + config.vm.define 'install-alma-10', primary: true do |test| + test.vm.hostname = 'smoke' + test.vm.provision "add-bin-path", type: "shell", inline: "echo \"export PATH=/usr/local/bin:\$PATH\" >> ~/.bashrc" + test.vm.provision "install-depedencies", type: "shell", inline: "dnf install -y kernel-modules-extra" + # This test image has an older kernel by default, so we need to reboot to load the new kernel modules + test.vm.provision 'k3s-reload', type: 'reload', run: 'once' + test.vm.provision 'k3s-upload', type: 'file', run: 'always', source: ENV['TEST_INSTALL_SH'], destination: 'install.sh' + test.vm.provision 'k3s-install', type: 'k3s', run: 'once' do |k3s| + k3s.installer_url = 'file:///home/vagrant/install.sh' + k3s.args = %w[server] + k3s.env = ENV.select{|k,v| k.start_with?('K3S_') || k.start_with?('INSTALL_K3S_')}.merge({ + :INSTALL_K3S_NAME => 'server', + }) + k3s.config = <<~YAML + selinux: true + token: 'vagrant' + YAML + end + waitForNodeReady(test.vm) + + waitForCoreDns(test.vm) + + waitForLocalStorage(test.vm) + + waitForMetricsServer(test.vm) + + waitForTraefik(test.vm) + + kubectlStatus(test.vm) + + checkK3sProcesses(test.vm) + + checkCGroupV2(test.vm) + + mountDirs(test.vm) + + runUninstall(test.vm) + + checkMountPoint(test.vm) + + unmountDir(test.vm) + end + + config.vm.provision 'selinux-status', type: 'shell', run: 'once', inline: 'sestatus' + + %w[libvirt virtualbox vmware_desktop].each do |p| + config.vm.provider p do |v| + v.cpus = ENV['TEST_VM_CPUS'] || 2 + v.memory = ENV['TEST_VM_MEMORY'] || 2048 + end + end + config.vm.provider :virtualbox do |v,o| + v.gui = false + v.check_guest_additions = false + end +end diff --git a/tests/install/centos-9/Vagrantfile b/tests/install/centos-9/Vagrantfile index b2a5080ced7..c76ed971c7b 100644 --- a/tests/install/centos-9/Vagrantfile +++ b/tests/install/centos-9/Vagrantfile @@ -6,7 +6,7 @@ ENV['TEST_INSTALL_SH'] ||= '../../../install.sh' Vagrant.configure("2") do |config| config.vagrant.plugins = ["vagrant-k3s"] - config.vm.box = "eurolinux-vagrant/centos-stream-9" + config.vm.box = "bento/centos-stream-9" config.vm.boot_timeout = ENV['TEST_VM_BOOT_TIMEOUT'] || 600 # seconds config.vm.synced_folder '.', '/vagrant', disabled: true diff --git a/tests/install/opensuse-leap/Vagrantfile b/tests/install/opensuse-leap/Vagrantfile index a8aca76432d..ee1dccdc909 100644 --- a/tests/install/opensuse-leap/Vagrantfile +++ b/tests/install/opensuse-leap/Vagrantfile @@ -6,7 +6,7 @@ ENV['TEST_INSTALL_SH'] ||= '../../../install.sh' Vagrant.configure("2") do |config| config.vagrant.plugins = ["vagrant-k3s"] - config.vm.box = 'opensuse/Leap-15.6.x86_64' + config.vm.box = 'bento/opensuse-leap-15' config.vm.boot_timeout = ENV['TEST_VM_BOOT_TIMEOUT'] || 600 # seconds config.vm.synced_folder '.', '/vagrant', disabled: true diff --git a/tests/install/rocky-9/Vagrantfile b/tests/install/rocky-9/Vagrantfile index f38c14995ed..4a8a52c2b11 100644 --- a/tests/install/rocky-9/Vagrantfile +++ b/tests/install/rocky-9/Vagrantfile @@ -3,11 +3,11 @@ # ENV['TEST_INSTALL_SH'] ||= '../../../install.sh' -ENV['INSTALL_K3S_CHANNEL'] ||= 'testing' +ENV['INSTALL_K3S_CHANNEL'] ||= 'latest' Vagrant.configure("2") do |config| config.vagrant.plugins = ["vagrant-k3s"] - config.vm.box = "eurolinux-vagrant/rocky-9" + config.vm.box = "bento/rockylinux-9" config.vm.boot_timeout = ENV['TEST_VM_BOOT_TIMEOUT'] || 600 # seconds config.vm.synced_folder '.', '/vagrant', disabled: true