环境:
ubuntu 20.04.3 LTS
minikube version: v1.23.2
启动minikuke报错 Container runtime must be set to “containerd” for rootless:
qin@ubuntu:~$ minikube start --memory=2200mb
* minikube v1.23.2 on Ubuntu 20.04
* Automatically selected the docker driver
! Your cgroup does not allow setting memory.
- More information: https://docs.docker.com/engine/install/linux-postinstall/#your-kernel-does-not-support-cgroup-swap-limit-capabilities
X The requested memory allocation of 2200MiB does not leave room for system overhead (total system memory: 2957MiB). You may face stability issues.
* Suggestion: Start minikube with less memory allocated: 'minikube start --memory=2200mb'
X Exiting due to MK_USAGE: Container runtime must be set to "containerd" for rootless
qin@ubuntu:~$
原因:
启动时需要指定容器运行时及docker驱动
Start a cluster using the rootless docker driver:
dockerd-rootless-setuptool.sh install -f
docker context use rootless
minikube start --driver=docker --container-runtime=containerd
解决:
qin@ubuntu:~$ minikube start --driver=docker --container-runtime=containerd
* minikube v1.23.2 on Ubuntu 20.04
* Using the docker driver based on user configuration
X The requested memory allocation of 2200MiB does not leave room for system overhead (total system memory: 2957MiB). You may face stability issues.
* Suggestion: Start minikube with less memory allocated: 'minikube start --memory=2200mb'
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* Downloading Kubernetes v1.22.2 preload ...
> index.docker.io/kicbase/sta...: 355.39 MiB / 355.40 MiB 100.00% 1.58 MiB
> preloaded-images-k8s-v13-v1...: 883.20 MiB / 929.22 MiB 95.05% 3.04 MiB ! minikube was unable to download gcr.io/k8s-minikube/kicbase:v0.0.27, but successfully downloaded docker.io/kicbase/stable:v0.0.27 as a fallback image
> preloaded-images-k8s-v13-v1...: 929.22 MiB / 929.22 MiB 100.00% 3.14 MiB
* Creating docker container (CPUs=2, Memory=2200MB) ...