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

kubelet service does not start failed to load Kubelet config file /var/lib/kubelet/config.yaml #2546

Closed
mosihra opened this issue Aug 16, 2021 · 4 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@mosihra
Copy link

mosihra commented Aug 16, 2021

What keywords did you search in kubeadm issues before filing this one?

If you have found any duplicates, you should instead reply there and close this page.

If you have not found any duplicates, delete this section and continue on.

Is this a BUG REPORT or FEATURE REQUEST?

Choose one: BUG REPORT or FEATURE REQUEST

Versions

kubeadm version (use kubeadm version):

Environment:

  • Kubernetes version (use kubectl version):

  • kubectl version
    Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.0", GitCommit:"c2b5237ccd9c0f1d600d3072634ca66cefdf272f", GitTreeState:"clean", BuildDate:"2021-08-04T18:03:20Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}

  • Cloud provider or hardware configuration: local Centos Stream 8

  • OS (e.g. from /etc/os-release):

  • [ms@k8master log]$ more /etc/os-release
    NAME="CentOS Stream"
    VERSION="8"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="8"
    PLATFORM_ID="platform:el8"
    PRETTY_NAME="CentOS Stream 8"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:8"
    HOME_URL="https://centos.org/"
    BUG_REPORT_URL="https://bugzilla.redhat.com/"
    REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
    REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
    [ms@k8master log]$

  • Others:

What happened?

Installed Kubernetes and kubelet service does not start. So I am not able to initiate kubernetes cluster.

What you expected to happen?

Service should start after instlallation

How to reproduce it (as minimally and precisely as possible)?

Tried to start Service using sudo systemctl start kubelet
and sudo tail -f messages

Anything else we need to know?

this is message from OS messages file
Aug 16 09:59:00 k8master systemd[1]: kubelet.service: Service RestartSec=10s expired, scheduling restart.
Aug 16 09:59:00 k8master systemd[1]: kubelet.service: Scheduled restart job, restart counter is at 4.
Aug 16 09:59:00 k8master systemd[1]: Stopped kubelet: The Kubernetes Node Agent.
Aug 16 09:59:00 k8master systemd[1]: Started kubelet: The Kubernetes Node Agent.
Aug 16 09:59:01 k8master kubelet[3882]: E0816 09:59:01.040695 3882 server.go:206] "Failed to load kubelet config file" err="failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to read kubelet config file "/var/lib/kubelet/config.yaml", error: open /var/lib/kubelet/config.yaml: no such file or directory" path="/var/lib/kubelet/config.yaml"
Aug 16 09:59:01 k8master systemd[1]: kubelet.service: Main process exited, code=exited, status=1/FAILURE
Aug 16 09:59:01 k8master systemd[1]: kubelet.service: Failed with result 'exit-code'.

[ms@k8master log]$ ls -asl /var/lib/kubelet
ls: cannot access '/var/lib/kubelet': No such file or directory
[ms@k8master log]$

[ms@k8master log]$ ls -asl /var/lib/kubelet/config.yaml
ls: cannot access '/var/lib/kubelet/config.yaml': No such file or directory
[ms@k8master log]$

@neolit123
Copy link
Member

see:
https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/#installing-kubeadm-kubelet-and-kubectl

The kubelet is now restarting every few seconds, as it waits in a crashloop for kubeadm to tell it what to do.

also:
https://github.com/kubernetes/kubeadm#support

/kind support

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Aug 16, 2021
@punitporwal07
Copy link

punitporwal07 commented Jun 28, 2023

I have the same issue, @mosihra may I know how did you manage to fix it? ; ta

@mithunkrb
Copy link

I'm also facing same issue, anyone could help me with the solution please? I tried changing permission of /var/run/containerd/containerd.sock to 666 but didn't help.

@bensalahmohameed
Copy link

From k8s documentation:
"Swap configuration. The default behavior of a kubelet was to fail to start if swap memory was detected on a node. Swap has been supported since v1.22. And since v1.28, Swap is supported for cgroup v2 only; the NodeSwap feature gate of the kubelet is beta but disabled by default.
You MUST disable swap if the kubelet is not properly configured to use swap. For example, sudo swapoff -a will disable swapping temporarily. To make this change persistent across reboots, make sure swap is disabled in config files like /etc/fstab, systemd.swap, depending how it was configured on your system."
This worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

6 participants