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

Exiting due to RSRC_INSUFFICIENT_SYS_MEMORY: System only has 0MiB available, less than the required 1800MiB for Kubernetes #10538

Closed
Jiu-hong opened this issue Feb 20, 2021 · 11 comments · Fixed by #10553
Assignees
Labels
co/docker-driver Issues related to kubernetes in container good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. os/linux priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@Jiu-hong
Copy link

Jiu-hong commented Feb 20, 2021

Steps to reproduce the issue:

I am doing according to this instruction exactly
https://phoenixnap.com/kb/install-minikube-on-ubuntu
Then I am failed at this step:
minikube start

Full output of failed command:

😄 minikube v1.17.1 on Ubuntu 20.04 (vbox/amd64)
✨ Automatically selected the docker driver

⛔ Exiting due to RSRC_INSUFFICIENT_SYS_MEMORY: System only has 0MiB available, less than the required 1800MiB for Kubernetes

Full output of minikube start command used, if not already included:

😄 minikube v1.17.1 on Ubuntu 20.04 (vbox/amd64)
✨ Automatically selected the docker driver

⛔ Exiting due to RSRC_INSUFFICIENT_SYS_MEMORY: System only has 0MiB available, less than the required 1800MiB for Kubernetes

Optional: Full output of minikube logs command:

@afbjorklund
Copy link
Collaborator

Sounds like a bug, can you post the output of free -m and cat /proc/meminfo ?

@afbjorklund afbjorklund added co/docker-driver Issues related to kubernetes in container os/linux kind/bug Categorizes issue or PR as related to a bug. labels Feb 20, 2021
@afbjorklund
Copy link
Collaborator

Can also try this sample code

package main

import (
	"fmt"

	"github.com/shirou/gopsutil/v3/mem"
)

func main() {
	v, _ := mem.VirtualMemory()

	fmt.Printf("Total: %v, Free:%v, UsedPercent:%f%%\n", v.Total, v.Free, v.UsedPercent)
}

@afbjorklund afbjorklund added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label Feb 20, 2021
@BLasan
Copy link
Contributor

BLasan commented Feb 20, 2021

@afbjorklund Can I work on this? I faced the same issue

@BLasan
Copy link
Contributor

BLasan commented Feb 20, 2021

/assign

@Jiu-hong
Copy link
Author

free -m output:

              total        used        free      shared  buff/cache   available
Mem:            978         166          97           0         714         642
Swap:             0           0           0

output of cat /proc/meminfo

MemTotal:        1002100 kB
MemFree:           99920 kB
MemAvailable:     657844 kB
Buffers:           52656 kB
Cached:           604272 kB
SwapCached:            0 kB
Active:           357724 kB
Inactive:         373036 kB
Active(anon):      82572 kB
Inactive(anon):      152 kB
Active(file):     275152 kB
Inactive(file):   372884 kB
Unevictable:       21940 kB
Mlocked:           18528 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         95812 kB
Mapped:            62116 kB
Shmem:               808 kB
KReclaimable:      75148 kB
Slab:             123488 kB
SReclaimable:      75148 kB
SUnreclaim:        48340 kB
KernelStack:        2332 kB
PageTables:         1904 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:      501048 kB
Committed_AS:     740148 kB
VmallocTotal:   34359738367 kB
VmallocUsed:        9172 kB
VmallocChunk:          0 kB
Percpu:            11520 kB
HardwareCorrupted:     0 kB
AnonHugePages:         0 kB
ShmemHugePages:        0 kB
ShmemPmdMapped:        0 kB
FileHugePages:         0 kB
FilePmdMapped:         0 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
Hugetlb:               0 kB
DirectMap4k:       96256 kB
DirectMap2M:      952320 kB

@afbjorklund
Copy link
Collaborator

Thank you, that looks more normal. It's still too small to run minikube, but it's not zero...

You need 2 GB RAM in the VM (and also 2 vCPU as well), rather than the current 1 GB.

@afbjorklund
Copy link
Collaborator

afbjorklund commented Feb 21, 2021

@BLasan The bug is here:

        if sysLimit < minUsableMem {
                exitIfNotForced(reason.RsrcInsufficientSysMemory, "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes", out.V{"size": containerLimit, "driver": drvName, "req": minUsableMem})
        }

Should use sysLimit, not containerLimit.

The second value is only relevant to KIC.

@afbjorklund afbjorklund added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Feb 21, 2021
@Jiu-hong
Copy link
Author

Thank you @afbjorklund. I did not realize the minimium require for minikube. I got it now! Thank you again!

@afbjorklund
Copy link
Collaborator

We try to mention it here: https://minikube.sigs.k8s.io/docs/start/ but the code is supposed to verify it...
The requirement actually comes from kubeadm, so mostly trying to provide sane defaults for minikube

It's a bit confusing since it talks about the memory total after the system and kernel take their share.
So even if you start out with a virtual hardware of 1024 MiB, then it only shows something like 978 MiB.

@BLasan
Copy link
Contributor

BLasan commented Feb 21, 2021

@BLasan The bug is here:

        if sysLimit < minUsableMem {
                exitIfNotForced(reason.RsrcInsufficientSysMemory, "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes", out.V{"size": containerLimit, "driver": drvName, "req": minUsableMem})
        }

Should use sysLimit, not containerLimit.

The second value is only relevant to KIC.

Yuh. Thanks for pointing us. Shall I send a PR for this?

@afbjorklund
Copy link
Collaborator

Shall I send a PR for this?

Please do, the current message is confusing

@afbjorklund afbjorklund added the good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. label Feb 21, 2021
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 good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. os/linux priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants