kubeadm init报错:https://33.10.133.19:6443/healthz?timeout=32s in 0 milliseconds

问题:kubeadm init的时候,报如下错:

 

 

解决:

 sudo vim /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

 

将内容替换为:

# Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/default/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS

 

然后,kubeadm reset -f 之后,重新kubeadm init就行了:

 

 

参考链接:https://blog.csdn.net/weixin_40161254/article/details/112232302

posted @ 2022-11-16 17:45  年轻人——001  阅读(690)  评论(0编辑  收藏  举报