From 3d1956e1e487dcc4493adaab7dbe7bf27922bd5f Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Wed, 7 Jan 2026 13:33:58 +0530 Subject: [PATCH] ci: use minikube github action instead script using github action for minikube will avoid unwanted errors and probably will be more stable than manual install. But both script and action both uses almost same time for installation so there we don't have preference. Signed-off-by: subhamkrai (cherry picked from commit 6c4d8205b63f64b1c483695e4e597b1b2fcdb9f9) --- .../workflows/canary-test-config/action.yaml | 17 +++++++-- .../action.yaml | 17 +++++++-- tests/scripts/github-action-helper.sh | 35 ------------------- 3 files changed, 30 insertions(+), 39 deletions(-) diff --git a/.github/workflows/canary-test-config/action.yaml b/.github/workflows/canary-test-config/action.yaml index 5fa88214b..66077a5a5 100644 --- a/.github/workflows/canary-test-config/action.yaml +++ b/.github/workflows/canary-test-config/action.yaml @@ -18,10 +18,23 @@ runs: with: go-version: "1.25" - - name: Setup Minikube + - name: Install cri-dockerd shell: bash --noprofile --norc -eo pipefail -x {0} run: | - tests/scripts/github-action-helper.sh install_minikube_with_none_driver v1.34.0 + curl -LO https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.21/cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb + sudo dpkg -i cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb + rm -f cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb + + - name: Setup Minikube + uses: medyagh/setup-minikube@latest + with: + kubernetes-version: v1.34.0 + driver: none + container-runtime: docker + memory: 6g + cpus: 2 + addons: ingress + cni: calico - name: install deps shell: bash --noprofile --norc -eo pipefail -x {0} diff --git a/.github/workflows/integration-test-config-latest-k8s/action.yaml b/.github/workflows/integration-test-config-latest-k8s/action.yaml index 260271850..21dd99d11 100644 --- a/.github/workflows/integration-test-config-latest-k8s/action.yaml +++ b/.github/workflows/integration-test-config-latest-k8s/action.yaml @@ -22,10 +22,23 @@ runs: with: go-version: "1.25" - - name: Setup Minikube + - name: Install cri-dockerd shell: bash --noprofile --norc -eo pipefail -x {0} run: | - tests/scripts/github-action-helper.sh install_minikube_with_none_driver ${{ inputs.kubernetes-version }} + curl -LO https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.21/cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb + sudo dpkg -i cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb + rm -f cri-dockerd_0.3.21.3-0.ubuntu-focal_amd64.deb + + - name: Setup Minikube + uses: medyagh/setup-minikube@latest + with: + kubernetes-version: ${{ inputs.kubernetes-version }} + driver: none + container-runtime: docker + memory: 6g + cpus: 2 + addons: ingress + cni: calico - name: print k8s cluster status shell: bash --noprofile --norc -eo pipefail -x {0} diff --git a/tests/scripts/github-action-helper.sh b/tests/scripts/github-action-helper.sh index 5bc0fc86a..6400a5926 100755 --- a/tests/scripts/github-action-helper.sh +++ b/tests/scripts/github-action-helper.sh @@ -713,41 +713,6 @@ function test_csi_nfs_workload { kubectl exec -t pod/csinfs-demo-pod -- ls -alh /var/lib/www/html/ } -function install_minikube_with_none_driver() { - CRICTL_VERSION="v1.34.0" - MINIKUBE_VERSION="v1.37.0" - - sudo apt update - sudo apt install -y conntrack socat - curl -LO https://storage.googleapis.com/minikube/releases/$MINIKUBE_VERSION/minikube_latest_amd64.deb - sudo dpkg -i minikube_latest_amd64.deb - rm -f minikube_latest_amd64.deb - # The dpkg install does not install the minikube binary to the needed location, so - # move the minikube binary to the expected location - sudo mv /usr/bin/minikube /usr/local/bin/minikube - - curl -LO https://github.com/Mirantis/cri-dockerd/releases/download/v0.4.0/cri-dockerd_0.4.0.3-0.ubuntu-focal_amd64.deb - sudo dpkg -i cri-dockerd_0.4.0.3-0.ubuntu-focal_amd64.deb - rm -f cri-dockerd_0.4.0.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.7.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" - - curl -LO "https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGIN_VERSION/$CNI_PLUGIN_TAR" - sudo mkdir -p "$CNI_PLUGIN_INSTALL_DIR" - sudo tar -xf "$CNI_PLUGIN_TAR" -C "$CNI_PLUGIN_INSTALL_DIR" - rm "$CNI_PLUGIN_TAR" - - export MINIKUBE_HOME=$HOME CHANGE_MINIKUBE_NONE_USER=true KUBECONFIG=$HOME/.kube/config - minikube start --kubernetes-version="$1" --driver=none --memory 6g --cpus=2 --addons ingress --cni=calico -} - function toolbox() { kubectl -n rook-ceph exec -it "$(kubectl -n rook-ceph get pod -l "app=rook-ceph-tools" -o jsonpath='{.items[0].metadata.name}')" -- "$@" }