Score:0

Kubelete fails with code=exited, status=1/FAILURE

th flag

I have setup K8S on fedora 37, following a

Kubeadmi init

seems images are pulled and things seemed correct. However, when I try

Kubectl cluster-info

0406 11:58:52.440579 704658 memcache.go:265] couldn't get current server API group list: Get "https://192.168.1.48:6443/api?timeout=32s": dial tcp 192.168.1.48:6443: connect: connection refused E0406 11:58:52.441106 704658 memcache.go:265] couldn't get current server API group list: Get "https://192.168.1.48:6443/api?timeout=32s": dial tcp 192.168.1.48:6443: connect: connection refused E0406 11:58:52.442602 704658 memcache.go:265] couldn't get current server API group list: Get "https://192.168.1.48:6443/api?timeout=32s": dial tcp 192.168.1.48:6443: connect: connection refused E0406 11:58:52.444035 704658 memcache.go:265] couldn't get current server API group list: Get "https://192.168.1.48:6443/api?timeout=32s": dial tcp 192.168.1.48:6443: connect: connection refused E0406 11:58:52.445543 704658 memcache.go:265] couldn't get current server API group list: Get "https://192.168.1.48:6443/api?timeout=32s": dial tcp 192.168.1.48:6443: connect: connection refused

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

after digging, I discovered thet kubelet service is not running, when I check its status I see

Process: 662008 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=1/FAILURE) Main PID: 662008 (code=exited, status=1/FAILURE)

I issue the command

sudo journalctl -xeu kubelet

I find some strange indication regarding swapp

Apr 06 11:46:05 puppetmaster29 kubelet[604092]: I0406 11:46:05.929992 604092 server.go:198] "--pod-infra-container-image will not be pruned by the image garbage collector in kubelet and should> Apr 06 11:46:05 puppetmaster29 kubelet[604092]: Flag --pod-infra-container-image has been deprecated, will be removed in 1.27. Image garbage collector will get sandbox image information from CR> Apr 06 11:46:05 puppetmaster29 kubelet[604092]: I0406 11:46:05.959288 604092 server.go:412] "Kubelet version" kubeletVersion="v1.26.3" Apr 06 11:46:05 puppetmaster29 kubelet[604092]: I0406 11:46:05.959563 604092 server.go:414] "Golang settings" GOGC="" GOMAXPROCS="" GOTRACEBACK="" Apr 06 11:46:05 puppetmaster29 kubelet[604092]: I0406 11:46:05.960072 604092 server.go:836] "Client rotation is on, will bootstrap in background" Apr 06 11:46:05 puppetmaster29 kubelet[604092]: I0406 11:46:05.962910 604092 certificate_store.go:130] Loading cert/key pair from "/var/lib/kubelet/pki/kubelet-client-current.pem". Apr 06 11:46:05 puppetmaster29 kubelet[604092]: I0406 11:46:05.964710 604092 dynamic_cafile_content.go:157] "Starting controller" name="client-ca-bundle::/etc/kubernetes/pki/ca.crt" Apr 06 11:46:05 puppetmaster29 kubelet[604092]: I0406 11:46:05.972921 604092 server.go:659] "--cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /" Apr 06 11:46:05 puppetmaster29 kubelet[604092]: E0406 11:46:05.973293 604092 run.go:74] "command failed" err="failed to run Kubelet: running with swap on is not supported, please disable swap!> Apr 06 11:46:05 puppetmaster29 systemd[1]: kubelet.service: Main process exited, code=exited, status=1/FAILURE ░░ Subject: Unit process exited ░░ Defined-By: systemd ░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel ░░ ░░ An ExecStart= process belonging to unit kubelet.service has exited. ░░ ░░ The process' exit code is 'exited' and its exit status is 1.

I have executed

sudo swappoff -a 

a couple of times and even commented it inside the fstab file as follows

/dev/mapper/fedora-root /                       xfs     defaults        0 0
UUID=50a98c60-a467-4c60-9fcb-e394c74043a7 /boot                   ext4    defaults        1 2
# /dev/mapper/fedora-swap swap                    swap    defaults        0 0
So not really know what to do or how to solve this, thanks for your help
in flag
(a) so after commenting out the swap, you rebooted? (b) kind of related to that, after issuing the swapoff you did `systemctl restart kubelet.service`?
eliassal avatar
th flag
Yes Sir, rebooted 2 times and restarted the kubelet service but always same thing
eliassal avatar
th flag
I even deleted the swap partition, rebooted, getting the exact same error in the log " command failed" err="failed to run Kubelet: running with swap on is not supported, please disable"
in flag
Welp, here is where kubernetes being open source really shines; you can [see what that check is doing](https://sourcegraph.com/github.com/kubernetes/[email protected]/-/blob/pkg/kubelet/cm/container_manager_linux.go?L210-211) and investigate for yourself. They also offer a [`--fail-swap-on=false`](https://github.com/kubernetes/kubernetes/issues/54542#issuecomment-565223605) if you want to roll the dice
eliassal avatar
th flag
sorry but I have never used GO language
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.