From 2c908b598cbb636732c82960ef240e3a3d3302fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 11 Sep 2023 16:05:14 +0200 Subject: [PATCH] ci: kata-deploy: Add the ability to deploy rke2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will be very useful in the near future, when we start testing kata-deploy with rke2 as well. Signed-off-by: Fabiano FidĂȘncio --- tests/gha-run-k8s-common.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/gha-run-k8s-common.sh b/tests/gha-run-k8s-common.sh index ba25a75393..2def893f27 100644 --- a/tests/gha-run-k8s-common.sh +++ b/tests/gha-run-k8s-common.sh @@ -150,12 +150,29 @@ function deploy_k3s() { cp /etc/rancher/k3s/k3s.yaml ~/.kube/config } +function deploy_rke2() { + curl -sfL https://get.rke2.io | sudo sh - + + systemctl enable --now rke2-server.service + + # This is an arbitrary value that came up from local tests + sleep 120s + + # Link the kubectl binary into /usr/bin + sudo ln -sf /var/lib/rancher/rke2/bin/kubectl /usr/local/bin/kubectl + + mkdir -p ~/.kube + sudo cp /etc/rancher/rke2/rke2.yaml ~/.kube/config + sudo chown ${USER}:${USER} ~/.kube/config +} + function deploy_k8s() { echo "::group::Deploying ${KUBERNETES}" case ${KUBERNETES} in k0s) deploy_k0s ;; k3s) deploy_k3s ;; + rke2) deploy_rke2 ;; *) >&2 echo "${KUBERNETES} flavour is not supported"; exit 2 ;; esac