k8s節點狀態Init:0/1


k8s節點狀態Init:0/1

在節點機器上打印日志:

journalctl -f -u kubelet

出現以下內容:

5月 29 15:27:34 k8snode2 kubelet[2249]: For verbose messaging see aws.Config.CredentialsChainVerboseErrors
5月 29 15:27:34 k8snode2 kubelet[2249]: E0529 15:27:34.623978 2249 remote_runtime.go:105] RunPodSandbox from runtime service failed: rpc error: code = Unknown desc = failed pulling image "registry.aliyuncs.com/google_containers/pause:3.2": Error response from daemon: Get https://registry.aliyuncs.com/v2/: dial tcp: lookup registry.aliyuncs.com on [::1]:53: read udp [::1]:33513->[::1]:53: read: connection refused
5月 29 15:27:34 k8snode2 kubelet[2249]: E0529 15:27:34.624037 2249 kuberuntime_sandbox.go:68] CreatePodSandbox for pod "kube-proxy-6r7gb_kube-system(0c37d7c5-694c-4952-a3c9-e468f4a37cfe)" failed: rpc error: code = Unknown desc = failed pulling image "registry.aliyuncs.com/google_containers/pause:3.2": Error response from daemon: Get https://registry.aliyuncs.com/v2/: dial tcp: lookup registry.aliyuncs.com on [::1]:53: read udp [::1]:33513->[::1]:53: read: connection refused
5月 29 15:27:34 k8snode2 kubelet[2249]: E0529 15:27:34.624054 2249 kuberuntime_manager.go:727] createPodSandbox for pod "kube-proxy-6r7gb_kube-system(0c37d7c5-694c-4952-a3c9-e468f4a37cfe)" failed: rpc error: code = Unknown desc = failed pulling image "registry.aliyuncs.com/google_containers/pause:3.2": Error response from daemon: Get https://registry.aliyuncs.com/v2/: dial tcp: lookup registry.aliyuncs.com on [::1]:53: read udp [::1]:33513->[::1]:53: read: connection refused
5月 29 15:27:34 k8snode2 kubelet[2249]: E0529 15:27:34.624097 2249 pod_workers.go:191] Error syncing pod 0c37d7c5-694c-4952-a3c9-e468f4a37cfe ("kube-proxy-6r7gb_kube-system(0c37d7c5-694c-4952-a3c9-e468f4a37cfe)"), skipping: failed to "CreatePodSandbox" for "kube-proxy-6r7gb_kube-system(0c37d7c5-694c-4952-a3c9-e468f4a37cfe)" with CreatePodSandboxError: "CreatePodSandbox for pod \"kube-proxy-6r7gb_kube-system(0c37d7c5-694c-4952-a3c9-e468f4a37cfe)\" failed: rpc error: code = Unknown desc = failed pulling image \"registry.aliyuncs.com/google_containers/pause:3.2\": Error response from daemon: Get https://registry.aliyuncs.com/v2/: dial tcp: lookup registry.aliyuncs.com on [::1]:53: read udp [::1]:33513->[::1]:53: read: connection refused"
5月 29 15:27:35 k8snode2 kubelet[2249]: W0529 15:27:35.831411 2249 cni.go:237] Unable to update cni config: no networks found in /etc/cni/net.d

 

解決方法:修改resolv.conf中的DNS

打開:

vi /etc/resolv.conf

添加一行:

nameserver 223.5.5.5

保存。

 

K8S安裝過程,可參考:https://www.cnblogs.com/xiaokantianse/p/14184303.html 。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM