有勇气的牛排博客
☰

K8S常见报错处理

有勇气的牛排 1849 云原生 2021-08-26 21:57:34

知止自律打卡-微信小程序APP
一款微信自律打卡小程序,支持自定义打卡项目、习惯记录、项目日记、专注计时与数据统计。自律打卡、学习打卡、读书打卡、健身打卡、运动打卡、减肥打卡、戒色打卡、养生打卡、戒烟、戒酒、戒熬夜等多种场景。万能打卡模板自由创建。可自定义每日打卡目标,记录习惯连续天数,可视化追踪成长进度。
了解产品详情 →
微信搜索「知止自律打卡」
知止自律打卡微信小程序

1 right host or port

The connection to the server localhost:8080 was refused - did you specify the right host or port?
解决方法:

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

image.png

2 初始化 healthz

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

解决方法

vim /etc/docker/daemon.json
{ "registry-mirrors": ["https://q5vcymug.mirror.aliyuncs.com"], "exec-opts": ["native.cgroupdriver=systemd"] }
systemctl restart docker kubeadm reset -f

3 检查不健康 healthz

kubectl get cs

报错:
Get "http://127.0.0.1:10251/healthz": dial tcp 127.0.0.1:10251: connect: connection

image.png

解决方法:

vim /etc/kubernetes/manifests/kube-controller-manager.yaml

注释掉27行:# - --port=0

vim /etc/kubernetes/manifests/kube-scheduler.yaml

注释掉19行:# - --port=0

然后master节点重启:kubelet(等待几秒即可)

systemctl restart kubelet.service

评论区

×
×