前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >初始化Kubenetes报错1:[kubelet-check] The HTTP call eal to ‘curl -sSL.

初始化Kubenetes报错1:[kubelet-check] The HTTP call eal to ‘curl -sSL.

作者头像
非著名运维
发布2022-06-22 15:34:48
发布2022-06-22 15:34:48
1.2K00
代码可运行
举报
文章被收录于专栏:非著名运维非著名运维
运行总次数:0
代码可运行

报错信息:

代码语言:javascript
代码运行次数:0
复制
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get http://localhost:10248/healthz: dial tcp [::1]:10248: connect: connection refused.

过程回顾:

代码语言:javascript
代码运行次数:0
复制
[root@test2 ~]# kubeadm init \
--apiserver-advertise-address=192.168.2.129 \
--image-repository registry.aliyuncs.com/google_containers \
--kubernetes-version v1.13.3 \
--service-cidr=10.1.0.0/16 \
--pod-network-cidr=10.244.0.0/16
......
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get http://localhost:10248/healthz: dial tcp [::1]:10248: connect: connection refused.

问题解决:

代码语言:javascript
代码运行次数:0
复制
[root@test2 ~]# vim /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
...
Environment="KUBELET_SYSTEM_PODS_ARGS=--pod-manifest-path=/etc/kubernetes/manifests --allow-privileged=true --fail-swap-on=false"

[root@test2 ~]# systemctl daemon-reload

[root@test2 ~]# systemctl restart kubelet

[root@test2 ~]# kubeadm init \
--apiserver-advertise-address=192.168.2.129 \
--image-repository registry.aliyuncs.com/google_containers \
--kubernetes-version v1.13.3 \
--service-cidr=10.1.0.0/16 \
--pod-network-cidr=10.244.0.0/16

......
Your Kubernetes master has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

You can now join any number of machines by running the following on each node
as root:

  kubeadm join 192.168.2.129:6443 --token si974n.v8615659h9x6x4xe --discovery-token-ca-cert-hash sha256:d6d1c5d0290ee0217d14d7d6bdea23b1fc911186e0ea94847a1f52d8ed32761d

 重新初始化Kubenetes成功。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-08-19,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 非著名运维 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 报错信息:
  • 过程回顾:
  • 问题解决:
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档