ci(setup-minikube): use cri-dockerd (#2149)

* fix(setup-minikube): use cri-dockerd

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix: add fix-broken flag to apt

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix: use focal deb file

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* chore: rerun apt-get update before installing

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix: install containerd with apt

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix: install runc with apt

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* debug: systemd docker service masked

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix: unmask docker service

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix: use binary and copy systemd unit files from repo

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix: remove port-forward of registry

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>
This commit is contained in:
Lukas 2022-06-27 15:50:16 +02:00 committed by GitHub
parent 18f745de5b
commit 4338275220
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 5 deletions

View File

@ -22,17 +22,41 @@ if ! conntrack --version &>/dev/null; then
sudo apt-get -qq -y install conntrack
fi
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/
if ! command -v minikube; then
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
sudo mv minikube /usr/local/bin/
fi
# Minikube needs cri-dockerd to run clusters 1.24+
CRI_DOCKERD_VERSION="${CRI_DOCKERD_VERSION:-0.2.3}"
CRI_DOCKERD_BINARY_URL="https://github.com/Mirantis/cri-dockerd/releases/download/v${CRI_DOCKERD_VERSION}/cri-dockerd-${CRI_DOCKERD_VERSION}.amd64.tgz"
curl -Lo cri-dockerd.tgz $CRI_DOCKERD_BINARY_URL
tar xfz cri-dockerd.tgz
sudo mv cri-dockerd/cri-dockerd /usr/bin/cri-docker
git clone https://github.com/Mirantis/cri-dockerd.git /tmp/cri-dockerd
sudo cp /tmp/cri-dockerd/packaging/systemd/* /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable cri-docker.service
sudo systemctl enable --now cri-docker.socket
if ! command -v crictl; then
CRICTL_VERSION="v1.24.1"
curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz --output 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
fi
sudo apt-get update
sudo apt-get install -y liblz4-tool
cat /proc/cpuinfo
sudo systemctl unmask docker
minikube start --vm-driver=none --force
minikube status
minikube addons enable registry
kubectl cluster-info
kubectl port-forward --namespace kube-system service/registry 5000:80 &