Skip to content

Commit

Permalink
ci(setup-minikube): use cri-dockerd (GoogleContainerTools#2149)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
Lukas committed Jun 27, 2022
1 parent 18f745d commit 4338275
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions scripts/minikube-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &

0 comments on commit 4338275

Please sign in to comment.