-
Notifications
You must be signed in to change notification settings - Fork 705
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
Preflight checks shall check hardware requirements. #1052
Comments
currently we do outline such requirements here: while we can use the what we can do is print a message about the system requirements when kubeadm starts. /priority backlog |
Hi, |
Print the requirements in the Preflight? |
that only helps if there is a difference to the used system. because this of course would be not only helpful for kubeadm but master/nodes as well. But there should definitely be a warning, if there are too few cores and ram allocated for the kubeadm/kubernetes master/nodes system |
this is doable but it has a complicated maintenance process.
as mentioned earlier, we cannot have portable multi-platform detection for that using golang yet and we wouldn't want to have to homecook different solutions for different OSes. |
Would be even easier to do preflight checks within a docker container than in kubeadm itself. since containers have to adhere to linux environments, /proc/{cpuinfo,meminfo} could be parsed and you wouldnt have to worry about other environments? :-)
Better than nothing, i'll take it. Though i do not understand why you couldnt do the other thing (docker preflight check) in the long term :-) |
contributions to kubeadm are always encouraged, of course. 👍 |
Perhaps we just update the docs to run the node e2e test suite prior to setup. |
we can do that. however, @deknos noted that the users are going to miss the system requirements notes and start a cluster anyway, which we don't handle correctly and it results in unexpected behavior:
given this is node specific it seems to me that this should be on the kubelet side. what we can do on the kubeadm side is show a warning / system req. notification. |
@neolit123, @timothysc what do you think about using something like this: https://github.com/pbnjay/memory to get total memory? According to this issue golang/go#21816 this kind of API doesn't have a lot of chances to go to standard library, so we probably should come up with something similar to above package. After all we need just a several lines of code for windows and linux to implement this. I think it makes sense to do to enforce requirements stated in the documentation. Even if we do it only for linux it will cover most of kubeadm user base in my opinion. |
yep, i saw the |
Implemented check for number of CPUs on master, please review: kubernetes/kubernetes#70048 |
@neolit123 as vendoring can be a problem can we just write our own similar code? |
i'm personally fine with having https://github.com/pbnjay/memory vendored in kubeadm. |
/assign @timothysc |
The check for number of CPUs on master looks good! but i do not really know to formally review it other than testing it in a VM? Shall i do that? The go memory library looks good, though i am a newbie to Golang, i could at least look at it. |
we have not decided yet if the the memory check library is going to be used. |
Yeah, i wanted to know if i could do anything to help. reviewing code or testing with a too small installation for example? :) |
@timothysc wdyt? |
(just stumbled across this!) happy to contribute directly if you all don't want to vendor the package. I also just added a BSD license to the repo if the missing license was a concern |
I would channel what is done by the kubelet/cadvisor where possible b/c it's already vendored. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/lifecycle frozen |
I'm interested in picking this up. To make sure I've understood the issue correctly, I'll start by summarizing the current state: It looks like this issue had two parts: checking the number of CPUs/cores and checking the amount of RAM. These checks need to work across platforms, including both Linux and Windows. The first part has already been merged, but the second part will require a cross-platform implementation that is not included in the Go standard library. kubelet/cadvisor is the top option for this because it is already vendored in k/k and supports Linux and Windows. kubelet/cadvisor has a MachineInfo type that includes both CPUs and RAM. Based on this, it makes sense to move the CPU check to also be based on cadvisor. |
@dpb587-pivotal and I have implemented this check using the pbnjay/memory library suggested earlier in this issue. You can see the changes here. We have not made a PR yet to avoid splitting the discussion, since there is still discussion to be had on the approach to take (vendoring this new library vs using kubectl/cadvisor). Before writing the above code, we looked at what would be needed to implement this using kubectl/cadvisor. That appears to be an uncomfortable fit for this task for a couple reasons: (1) The (2) The Windows implementation claims to start a metrics server (as opposed to just returning a couple of current numbers). Windows support is a reason to use @timothysc given that additional technical context, do you have concerns about pulling in this new metrics package vs trying to use kubelet/cadvisor? |
this fell of my radar completely, but to answer the above query:
this seems like the right approach, so if someone wants to send a PR we might get acceptance for it.
we should definitely not use kubelet/cadvisor given kubeadm is moving away from k/k and the kubelet is trying to decouple from cadvisor. PRs welcome. |
@neolit123 I'd like to pick this up. And will use https://github.com/pbnjay/memory to check the memory. /assign |
@xlgao-zju thanks. we might want to make this change for 1.20, because it's too close to feature-freeze (9th of July). |
Dropping a note that 2GB is definitely not a hard requirement and that necessary resources depend on the size and scope of the rest of the cluster. kind runs kubeadm + a light workload in less. |
on the PR i recommended to have this is a warning. |
/lifecycle active |
What keywords did you search in kubeadm issues before filing this one?
core, cpu
Is this a BUG REPORT or FEATURE REQUEST?
depends.. a FeatureRequest.
Preflight Checks should include whether at least 2 cores and 2Gb RAM are availabe.
I had a machine where i tried to install it and it had only 1 core. and it initially worked often, but containers went down after a time and it did not work properly.
I wish for a comment like: "This machine has only 1 core and NGb Ram, but usually kubeadm needs at least 2 cores and 2 GB Ram to work properly."
Versions
kubeadm version (use
kubeadm version
) :kubeadm version: &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:50:16Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Environment:
Kubernetes version (use
kubectl version
):Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:53:20Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:08:19Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Cloud provider or hardware configuration:
Debian 9, OpenTelekom Cloud, Elastic Computing Instance.
OS (e.g. from /etc/os-release):
root@debian9kub01:/home/linux# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
Kernel (e.g.
uname -a
):Linux debian9kub01 4.9.0-7-amd64 kubeadm join on slave node fails preflight checks #1 SMP Debian 4.9.110-3+deb9u1 (2018-08-03) x86_64 GNU/Linux
Others:
What happened?
kubeadm installed often successfully but operations never really worked, but containers often shut down.
What you expected to happen?
a warning that the host configuration is not sufficient
How to reproduce it (as minimally and precisely as possible)?
try to run a kubernetes cluster installed with kubeadm on a machine with 1 core and 2gb ram
The text was updated successfully, but these errors were encountered: