Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error at "minikube start" #9792

Closed
chiehpower opened this issue Nov 27, 2020 · 12 comments
Closed

Error at "minikube start" #9792

chiehpower opened this issue Nov 27, 2020 · 12 comments
Labels
co/docker-driver Issues related to kubernetes in container kind/support Categorizes issue or PR as a support question. os/linux

Comments

@chiehpower
Copy link

I cannot change the cpu number even I already assigned a specific nubmer of cpu.

Full output of failed command:

kf-test ›› minikube start --cpus 16 --memory 12g --disk-size 15g                                                                                                                                         
😄  minikube v1.14.1 on Ubuntu 18.04
✨  Automatically selected the docker driver
👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=16, Memory=12288MB) ...

⛔  Exiting due to RSRC_INSUFFICIENT_CORES: Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available
kf-test ›› minikube start -n 4 --memory 12g --disk-size 15g                                                                                                                                              
😄  minikube v1.14.1 on Ubuntu 18.04
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🤷  docker "minikube" container is missing, will recreate.
🔥  Creating docker container (CPUs=16, Memory=12288MB) ...

⛔  Exiting due to RSRC_INSUFFICIENT_CORES: Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available

If there anyone know how to fix it?

Thank you so much!

@chiehpower chiehpower changed the title minikube start Error at "minikube start" Nov 27, 2020
@afbjorklund
Copy link
Collaborator

Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available

The Linux machine you are running this on, needs to have more than 2 vCPU available
Adding more resources to the docker driver, will only set the limits (not change the host).

It should probably be an error, trying to set the limit above what is available on the host.
Possibly we should show the amount resources available to the host, after the OS ?

@afbjorklund afbjorklund added os/linux co/docker-driver Issues related to kubernetes in container kind/support Categorizes issue or PR as a support question. labels Nov 29, 2020
@chiehpower
Copy link
Author

Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available

The Linux machine you are running this on, needs to have more than 2 vCPU available
Adding more resources to the docker driver, will only set the limits (not change the host).

It should probably be an error, trying to set the limit above what is available on the host.
Possibly we should show the amount resources available to the host, after the OS ?

Dear afbjorklund,

Thanks for your information!
I will try that and update on here!

@chiehpower
Copy link
Author

Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available

The Linux machine you are running this on, needs to have more than 2 vCPU available
Adding more resources to the docker driver, will only set the limits (not change the host).

It should probably be an error, trying to set the limit above what is available on the host.
Possibly we should show the amount resources available to the host, after the OS ?

Dear @afbjorklund,

After I tested some settings about docker, but it could not be solved.
(Not sure whether my solving direction was correct or not.)

Here are my steps

~ ›› sudo docker info                                                                                               
Client:
 Debug Mode: false

Server:
 Containers: 5
  Running: 3
  Paused: 1
  Stopped: 1
 Images: 76
 Server Version: 19.03.13
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: nvidia runc
 Default Runtime: runc
 Init Binary: docker-init
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-53-generic
 Operating System: Ubuntu 18.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.32GiB
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Hence, go to add one line

sudo nano /etc/default/grub  

Like

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
#GRUB_CMDLINE_LINUX=""
GRUB_CMDLINE_LINUX="cdgroup_enable=memory swapaccount=1"

sudo update-grub

Then reboot, and docker info again.
And then solved the WARNING: No swap limit support

But when I minikube again.

minikube start --driver=docker -n 4 

It still cannot let me assign the cpu nubmer.

😄  minikube v1.14.1 on Ubuntu 18.04
✨  Using the docker driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=16, Memory=2200MB) ...

⛔  Exiting due to RSRC_INSUFFICIENT_CORES: Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available

I am sorry that would you like to give me some hints or reference to let me study further.
I got stuck on here for a long time, and I have no idea.

Thank you so much!!

@chiehpower
Copy link
Author

It is so strange but if I start by a lower version of k8s, it can work!

Command

minikube start --kubernetes-version v1.15.12    

Output

~ ›› minikube start --kubernetes-version v1.15.12                                                                                                                                     
😄  minikube v1.14.1 on Ubuntu 18.04
✨  Automatically selected the docker driver
👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=2, Memory=8000MB) ...
✋  Stopping node "minikube"  ...
🛑  Powering off "minikube" via SSH ...
🔥  Deleting "minikube" in docker ...
🤦  StartHost failed, but will try again: creating host: create: provisioning: ssh command error:
command : sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
err     : Process exited with status 1
output  : sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

🔥  Creating docker container (CPUs=2, Memory=8000MB) ...
😿  Failed to start docker container. Running "minikube delete" may fix it: creating host: create: provisioning: ssh command error:
command : sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
err     : Process exited with status 1
output  : sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

❗  Startup with docker driver failed, trying with alternate driver virtualbox: Failed to start host: creating host: create: provisioning: ssh command error:
command : sudo hostname minikube && echo "minikube" | sudo tee /etc/hostname
err     : Process exited with status 1
output  : sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?

🔥  Deleting "minikube" in docker ...
🔥  Deleting container "minikube" ...
🔥  Removing /home/chieh/.minikube/machines/minikube ...
💀  Removed all traces of the "minikube" cluster.
💿  Downloading VM boot image ...
    > minikube-v1.14.0.iso.sha256: 65 B / 65 B [-------------] 100.00% ? p/s 0s
    > minikube-v1.14.0.iso: 178.27 MiB / 178.27 MiB [ 100.00% 11.02 MiB p/s 17s
👍  Starting control plane node minikube in cluster minikube
🔥  Creating virtualbox VM (CPUs=2, Memory=6000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.15.12 on Docker 19.03.12 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" by default

Thank you so much.

@seanrmurphy
Copy link

I found the error message quite confusing:

X Exiting due to RSRC_INSUFFICIENT_CORES: Docker has less than 2 CPUs available, but Kubernetes requires at least 2 to be available

I was running on Ubuntu 20.04 server and trying to create a minikube cluster with 6 (v)CPUs on a VM with 4 (v)CPUs (my bad, obviously) - clearly, there are insufficient cores and I guess the RSRC_INSUFFICIENT_CORES error should be expected; however the associated error message was incorrect in my case (Docker had more than 2 (v)CPUs available). When I dialled the required (v)CPUs down to 4 in minikube start, everything worked fine.

@afbjorklund
Copy link
Collaborator

@seanrmurphy : That is a separate bug, the "2" seem to be hardcoded in the message.

@seanrmurphy
Copy link

Good point @afbjorklund - I will make a separate issue. Thanks for responding promptly!

@openrory
Copy link

Just ran into the same message. What worked for me was to:

  1. install Podman
  2. create a VM with 2 CPUs: podman machine init --cpus=2
  3. start the VM podman machine start
  4. start Minikube with Podman as driver minikube start --driver=podman

@sahasrakalahasthi
Copy link

2. podman machine init --cpus=2

While doing this its directly showing Killed
ubuntu@ip-172-31-0-45:~$ podman machine init --cpus=2
Killed
what to do

@arunmrm
Copy link

arunmrm commented Feb 29, 2024

2. podman machine init --cpus=2

Error: exec: "qemu-system-x86_64": executable file not found in $PATH

This is the error that I got

@cheezad
Copy link

cheezad commented Feb 29, 2024

  1. podman machine init --cpus=2

Error: exec: "qemu-system-x86_64": executable file not found in $PATH

This is the error that I got

So I encountered the same error and my solution is

sudo apt-get install qemu-system-x86

Hope this helps!

@arunmrm
Copy link

arunmrm commented Mar 1, 2024

ok, Alternatively, I updated my EC2 instance to t3.medium, which has 2 CPUs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/support Categorizes issue or PR as a support question. os/linux
Projects
None yet
Development

No branches or pull requests

7 participants