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 <srai@redhat.com>
(cherry picked from commit 6c4d8205b6)
This commit is contained in:
1 parent
79d82c0b08
commit
3d1956e1e4
3 files changed
+30
-39
No files matched your search
@@ -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}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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}')" -- "$@"
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user