{"id":6409,"date":"2019-08-29T06:28:52","date_gmt":"2019-08-29T06:28:52","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=6409"},"modified":"2021-11-16T10:56:05","modified_gmt":"2021-11-16T10:56:05","slug":"kubeadm-error-kubelet-isnt-running-or-healthy-and-connection-refused","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/kubeadm-error-kubelet-isnt-running-or-healthy-and-connection-refused\/","title":{"rendered":"kubeadm error &#8211; kubelet isn&#8217;t running or healthy and connection refused"},"content":{"rendered":"\n<p><strong>Errors Headlines<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Initial timeout of 40s passed<\/li><li>dial tcp [::1]:10248: connect: connection refused<\/li><li>failed with error: Get http:\/\/localhost:10248\/healthz<\/li><li>The kubelet is not running<\/li><li><\/li><\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">&#91;wait-control-plane] Waiting <span class=\"hljs-keyword\">for<\/span> the kubelet to boot up the control plane <span class=\"hljs-keyword\">as<\/span> sta                                  tic Pods from directory <span class=\"hljs-string\">\"\/etc\/kubernetes\/manifests\"<\/span>. This can take up to <span class=\"hljs-number\">4<\/span>m0s\n&#91;kubelet-check] Initial timeout of <span class=\"hljs-number\">40<\/span>s passed.\n&#91;kubelet-check] It seems like the kubelet isn<span class=\"hljs-string\">'t running or healthy.\n&#91;kubelet-check] The HTTP call equal to '<\/span>curl -sSL http:<span class=\"hljs-comment\">\/\/localhost:10248\/healthz' failed with error: Get http:\/\/localhost:10248\/healthz: dial tcp &#91;::1]:10248: connect: connection refused.<\/span>\n&#91;kubelet-check] It seems like the kubelet isn<span class=\"hljs-string\">'t running or healthy.\n&#91;kubelet-check] The HTTP call equal to '<\/span>curl -sSL http:<span class=\"hljs-comment\">\/\/localhost:10248\/healthz' failed with error: Get http:\/\/localhost:10248\/healthz: dial tcp &#91;::1]:10248: connect: connection refused.<\/span>\n&#91;kubelet-check] It seems like the kubelet isn<span class=\"hljs-string\">'t running or healthy.\n&#91;kubelet-check] The HTTP call equal to '<\/span>curl -sSL http:<span class=\"hljs-comment\">\/\/localhost:10248\/healthz' failed with error: Get http:\/\/localhost:10248\/healthz: dial tcp &#91;::1]:10248: connect: connection refused.<\/span>\n&#91;kubelet-check] It seems like the kubelet isn<span class=\"hljs-string\">'t running or healthy.\n&#91;kubelet-check] The HTTP call equal to '<\/span>curl -sSL http:<span class=\"hljs-comment\">\/\/localhost:10248\/healthz' failed with error: Get http:\/\/localhost:10248\/healthz: dial tcp &#91;::1]:10248: connect: connection refused.<\/span>\n&#91;kubelet-check] It seems like the kubelet isn<span class=\"hljs-string\">'t running or healthy.\n&#91;kubelet-check] The HTTP call equal to '<\/span>curl -sSL http:<span class=\"hljs-comment\">\/\/localhost:10248\/healthz' failed with error: Get http:\/\/localhost:10248\/healthz: dial tcp &#91;::1]:10248: connect: connection refused.<\/span>\nUnfortunately, an error has occurred:\n        timed out waiting <span class=\"hljs-keyword\">for<\/span> the condition\nThis error is likely caused by:\n        - The kubelet is not running\n        - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)\n<span class=\"hljs-keyword\">If<\/span> you are on a systemd-powered system, you can <span class=\"hljs-keyword\">try<\/span> to troubleshoot the error with the following commands:\n        - <span class=\"hljs-string\">'systemctl status kubelet'<\/span>\n        - <span class=\"hljs-string\">'journalctl -xeu kubelet'<\/span>\nAdditionally, a control plane component may have crashed <span class=\"hljs-keyword\">or<\/span> exited when started by the container runtime.\nTo troubleshoot, <span class=\"hljs-keyword\">list<\/span> all containers using your preferred container runtimes CLI, e.g. docker.\nHere is one example how you may <span class=\"hljs-keyword\">list<\/span> all Kubernetes containers running in docker:\n        - <span class=\"hljs-string\">'docker ps -a | grep kube | grep -v pause'<\/span>\n        Once you have found the failing container, you can inspect its logs with:\n        - <span class=\"hljs-string\">'docker logs CONTAINERID'<\/span>\nerror execution phase wait-control-plane: couldn<span class=\"hljs-string\">'t initialize a Kubernetes cluster<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><strong>Solutions<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:<br>         <strong>&#8211; &#8216;systemctl status kubelet&#8217;<\/strong><br>      <strong>   &#8211; &#8216;journalctl -xeu kubelet&#8217;<\/strong><br> Additionally, a control plane component may have crashed or exited when started by the container runtime.<br> To troubleshoot, list all containers using your preferred container runtimes CLI, e.g. docker.<br> Here is one example how you may list all Kubernetes containers running in docker:<br>         <strong>&#8211; &#8216;docker ps -a | grep kube | grep -v pause&#8217;<\/strong><br>         Once you have found the failing container, you can inspect its logs with:<br>       <strong>  &#8211; &#8216;docker logs CONTAINERID&#8217;<\/strong><br> error execution phase wait-control-plane: couldn&#8217;t initialize a Kubernetes cluster<\/p><\/blockquote>\n\n\n\n<p><strong>Fix<\/strong><\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\">sudo swapoff -a\nsudo sed -i <span class=\"hljs-string\">'\/ swap \/ s\/^\/#\/'<\/span> \/etc\/fstab\n<span class=\"hljs-comment\"># Reboot a machine after that.<\/span>\nkubeadm reset\nkubeadm init --ignore-preflight-errors all<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_73301\"><iframe loading=\"lazy\"  id=\"_ytid_58715\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_73301\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Errors Headlines Initial timeout of 40s passed dial tcp [::1]:10248: connect: connection refused failed with error: Get http:\/\/localhost:10248\/healthz The kubelet is not running Solutions If you are on a systemd-powered&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4859],"tags":[],"class_list":["post-6409","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=6409"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6409\/revisions"}],"predecessor-version":[{"id":25461,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6409\/revisions\/25461"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=6409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=6409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=6409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}