From 62f075e3d5e8bef2db563684b74111d46fb251ad Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Mon, 23 Sep 2024 11:12:20 +0530 Subject: [PATCH] ci: fix ci permission issue with minikube start this commit upgrade the minikube, k8s, crictl versions in CI and also fix permission error in the github runner. Signed-off-by: subhamkrai --- .github/workflows/cluster-setup/action.yaml | 7 ++++--- tests/github-action-helper.sh | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cluster-setup/action.yaml b/.github/workflows/cluster-setup/action.yaml index 28da0ef..20f3daa 100644 --- a/.github/workflows/cluster-setup/action.yaml +++ b/.github/workflows/cluster-setup/action.yaml @@ -17,18 +17,19 @@ runs: - name: Setup Minikube shell: bash --noprofile --norc -eo pipefail -x {0} run: | - tests/github-action-helper.sh install_minikube_with_none_driver v1.30.2 + tests/github-action-helper.sh install_minikube_with_none_driver v1.31.0 - name: print k8s cluster status shell: bash --noprofile --norc -eo pipefail -x {0} run: | - minikube status - kubectl get nodes + kubectl cluster-info + kubectl get pods -n kube-system - name: use local disk shell: bash --noprofile --norc -eo pipefail -x {0} run: tests/github-action-helper.sh use_local_disk + - name: deploy rook cluster shell: bash --noprofile --norc -eo pipefail -x {0} if: inputs.op-ns == 'rook-ceph' || inputs.cluster-ns == 'rook-ceph' diff --git a/tests/github-action-helper.sh b/tests/github-action-helper.sh index e423c6c..6d68f7d 100755 --- a/tests/github-action-helper.sh +++ b/tests/github-action-helper.sh @@ -76,7 +76,7 @@ deploy_rook_in_custom_namespace() { deploy_csi_driver_custom_ns "$OPERATOR_NS" "$CLUSTER_NS" } -create_sc_with_retain_policy(){ +create_sc_with_retain_policy() { export OPERATOR_NS=$1 export CLUSTER_NS=$2 @@ -209,8 +209,8 @@ timeout_command_exit_code() { } install_minikube_with_none_driver() { - CRICTL_VERSION="v1.28.0" - MINIKUBE_VERSION="v1.33.1" + CRICTL_VERSION="v1.31.1" + MINIKUBE_VERSION="v1.34.0" sudo apt update sudo apt install -y conntrack socat @@ -218,16 +218,16 @@ install_minikube_with_none_driver() { sudo dpkg -i minikube_latest_amd64.deb rm -f minikube_latest_amd64.deb - curl -LO https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.4/cri-dockerd_0.3.4.3-0.ubuntu-focal_amd64.deb - sudo dpkg -i cri-dockerd_0.3.4.3-0.ubuntu-focal_amd64.deb - rm -f cri-dockerd_0.3.4.3-0.ubuntu-focal_amd64.deb + curl -LO https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.15/cri-dockerd_0.3.15.3-0.ubuntu-focal_amd64.deb + sudo dpkg -i cri-dockerd_0.3.15.3-0.ubuntu-focal_amd64.deb + rm -f cri-dockerd_0.3.15.3-0.ubuntu-focal_amd64.deb wget https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-$CRICTL_VERSION-linux-amd64.tar.gz sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin rm -f crictl-$CRICTL_VERSION-linux-amd64.tar.gz sudo sysctl fs.protected_regular=0 - CNI_PLUGIN_VERSION="v1.3.0" + CNI_PLUGIN_VERSION="v1.5.1" CNI_PLUGIN_TAR="cni-plugins-linux-amd64-$CNI_PLUGIN_VERSION.tgz" # change arch if not on amd64 CNI_PLUGIN_INSTALL_DIR="/opt/cni/bin" @@ -237,7 +237,7 @@ install_minikube_with_none_driver() { rm "$CNI_PLUGIN_TAR" export MINIKUBE_HOME=$HOME CHANGE_MINIKUBE_NONE_USER=true KUBECONFIG=$HOME/.kube/config - sudo -E minikube start --kubernetes-version="$1" --driver=none --memory 6g --cpus=2 --addons ingress --cni=calico + minikube start --kubernetes-version="$1" --driver=none --memory 6g --cpus=2 --addons ingress --cni=calico } install_external_snapshotter() {