kubeadm安裝報錯怎么辦

這篇文章給大家分享的是有關(guān)kubeadm安裝報錯怎么辦的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

公司主營業(yè)務(wù):成都網(wǎng)站制作、成都網(wǎng)站設(shè)計、移動網(wǎng)站開發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競爭能力。創(chuàng)新互聯(lián)建站是一支青春激揚、勤奮敬業(yè)、活力青春激揚、勤奮敬業(yè)、活力澎湃、和諧高效的團隊。公司秉承以“開放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對我們的高要求,感謝他們從不同領(lǐng)域給我們帶來的挑戰(zhàn),讓我們激情的團隊有機會用頭腦與智慧不斷的給客戶帶來驚喜。創(chuàng)新互聯(lián)建站推出南樂免費做網(wǎng)站回饋大家。

kubeadm安裝報錯

現(xiàn)象:

由于1.15版本太低,想安裝最新版本 但升級需要逐個升級,所以放棄 直接重新安裝。先kubeadm reset,然后按照之前的步驟 安裝k8s:

master節(jié)點kubeadm初始化報錯如下:

[root@k01 ~]# kubeadm init --apiserver-advertise-address=10.129.42.131 --image-repository registry.cn-hangzhou.aliyuncs.com/lfy_k8s_images --kubernetes-version v1.21.0 --service-cidr=10.96.0.0/16 --pod-network-cidr=192.168.0.0/16
……
[control-plane] Using manifest folder "/etc/kubernetes/manifests"
[control-plane] Creating static Pod manifest for "kube-apiserver"
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take u
p to 4m0s[kubelet-check] Initial timeout of 40s passed.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp:
 lookup localhost on 8.8.8.8:53: no such host.[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp:
 lookup localhost on 8.8.8.8:53: no such host.[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp:
 lookup localhost on 8.8.8.8:53: no such host.[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp:
 lookup localhost on 8.8.8.8:53: no such host.[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp:
 lookup localhost on 8.8.8.8:53: no such host.
	Unfortunately, an error has occurred:
		timed out waiting for the condition

	This error is likely caused by:
		- The kubelet is not running
		- The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

	If you are on a systemd-powered system, you can try to troubleshoot the error with the following commands:
		- 'systemctl status kubelet'
		- 'journalctl -xeu kubelet'

	Additionally, a control plane component may have crashed or exited when started by the container runtime.
	To troubleshoot, list all containers using your preferred container runtimes CLI.

	Here is one example how you may list all Kubernetes containers running in docker:
		- 'docker ps -a | grep kube | grep -v pause'
		Once you have found the failing container, you can inspect its logs with:
		- 'docker logs CONTAINERID'

error execution phase wait-control-plane: couldn't initialize a Kubernetes cluster
To see the stack trace of this error execute with --v=5 or higher

排查過程

1、根據(jù)輸出結(jié)果排查:

kubelet處于active狀態(tài) 正常;

根據(jù)輸出結(jié)果發(fā)現(xiàn),為什么會去lookup localhost on 8.8.8.8:53呢?抱著不解 去ping 了一下localhost,結(jié)果是127.0.0.1 好像沒什么問題,就忽略了這個報錯……

根據(jù)報錯內(nèi)容 手動排查,結(jié)果也是ok的。

[root@k01 ~]# curl -sSL http://localhost:10248/healthz
ok

2、查看messages日志

日志內(nèi)容和輸出差不多,但能夠看出是網(wǎng)絡(luò)問題:

[root@k01 ~]# tail -f /var/log/messages
May 17 13:01:07 DouyuTest01 kubelet: I0517 13:01:07.003029   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:07 DouyuTest01 kubelet: E0517 13:01:07.799345   10865 kubelet.go:2218] "Container runtime network not ready" networkReady="NetworkReady
=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"May 17 13:01:07 DouyuTest01 kubelet: I0517 13:01:07.983382   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:07 DouyuTest01 kubelet: I0517 13:01:07.983386   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:07 DouyuTest01 kubelet: I0517 13:01:07.983455   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:08 DouyuTest01 kubelet: I0517 13:01:08.003006   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:08 DouyuTest01 kubelet: I0517 13:01:08.983542   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:08 DouyuTest01 kubelet: I0517 13:01:08.983550   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:08 DouyuTest01 kubelet: I0517 13:01:08.983594   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:09 DouyuTest01 kubelet: I0517 13:01:09.003077   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:09 DouyuTest01 kubelet: I0517 13:01:09.983455   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:09 DouyuTest01 kubelet: I0517 13:01:09.983469   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:09 DouyuTest01 kubelet: I0517 13:01:09.983513   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:10 DouyuTest01 kubelet: I0517 13:01:10.003036   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:10 DouyuTest01 kubelet: E0517 13:01:10.025554   10865 event.go:273] Unable to write event: '&v1.Event{TypeMeta:v1.TypeMeta{Kind:"", API
Version:""}, ObjectMeta:v1.ObjectMeta{Name:"k01.167fc1eedabaafaa", GenerateName:"", Namespace:"default", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, InvolvedObject:v1.ObjectReference{Kind:"Node", Namespace:"", Name:"k01", UID:"k01", APIVersion:"", ResourceVersion:"", FieldPath:""}, Reason:"Starting", Message:"Starting kubelet.", Source:v1.EventSource{Component:"kubelet", Host:"k01"}, FirstTimestamp:v1.Time{Time:time.Time{wall:0xc0209bf99d5e33aa, ext:6597724002, loc:(*time.Location)(0x74ad9e0)}}, LastTimestamp:v1.Time{Time:time.Time{wall:0xc0209bf99d5e33aa, ext:6597724002, loc:(*time.Location)(0x74ad9e0)}}, Count:1, Type:"Normal", EventTime:v1.MicroTime{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, Series:(*v1.EventSeries)(nil), Action:"", Related:(*v1.ObjectReference)(nil), ReportingController:"", ReportingInstance:""}': 'Post "https://10.129.42.131:6443/api/v1/namespaces/default/events": dial tcp 10.129.42.131:6443: connect: connection refused'(may retry after sleeping)May 17 13:01:10 DouyuTest01 kubelet: E0517 13:01:10.107623   10865 controller.go:144] failed to ensure lease exists, will retry in 7s, error: Get "h
ttps://10.129.42.131:6443/apis/coordination.k8s.io/v1/namespaces/kube-node-lease/leases/k01?timeout=10s": dial tcp 10.129.42.131:6443: connect: connection refusedMay 17 13:01:10 DouyuTest01 kubelet: I0517 13:01:10.715642   10865 kubelet_node_status.go:71] "Attempting to register node" node="k01"
May 17 13:01:10 DouyuTest01 kubelet: E0517 13:01:10.716053   10865 kubelet_node_status.go:93] "Unable to register node with API server" err="Post \"
https://10.129.42.131:6443/api/v1/nodes\": dial tcp 10.129.42.131:6443: connect: connection refused" node="k01"May 17 13:01:10 DouyuTest01 kubelet: I0517 13:01:10.983585   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:10 DouyuTest01 kubelet: I0517 13:01:10.983675   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:10 DouyuTest01 kubelet: I0517 13:01:10.984259   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:11 DouyuTest01 kubelet: I0517 13:01:11.003219   10865 kubelet.go:461] "Kubelet nodes not sync"
May 17 13:01:11 DouyuTest01 kubelet: I0517 13:01:11.133807   10865 cni.go:239] "Unable to update cni config" err="no networks found in /etc/cni/net.

3、百度

百度也沒結(jié)果,死馬當(dāng)活馬醫(yī),修改了localhost的hosts映射關(guān)系:

[root@k01 ~]# cat /etc/hosts
10.129.42.131 k01 localhost
10.129.42.151 k02
10.129.42.152 k03
10.129.42.155 hub.atguigu.com

問題解決了,繼續(xù)初始化如下:

……
[control-plane] Creating static Pod manifest for "kube-controller-manager"
[control-plane] Creating static Pod manifest for "kube-scheduler"
[etcd] Creating static Pod manifest for local etcd in "/etc/kubernetes/manifests"
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests". This can take u
p to 4m0s[kubelet-check] Initial timeout of 40s passed.
[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 
10.129.42.131:10248: connect: connection refused.[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 
10.129.42.131:10248: connect: connection refused.[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp 
10.129.42.131:10248: connect: connection refused.[apiclient] All control plane components are healthy after 65.003162 seconds
……

解決方案

添加了10.129.42.131 localhost一條hosts記錄;

[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:10248/healthz": dial tcp:
 lookup localhost on 8.8.8.8:53: no such host.[kubelet-check] It seems like the kubelet isn't running or healthy.

感謝各位的閱讀!關(guān)于“kubeadm安裝報錯怎么辦”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

分享題目:kubeadm安裝報錯怎么辦
轉(zhuǎn)載源于:http://muchs.cn/article30/gesppo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名虛擬主機、做網(wǎng)站、Google網(wǎng)站營銷、網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

h5響應(yīng)式網(wǎng)站建設(shè)