gpt4 book ai didi

K8S常见报错处理

转载 作者:知者 更新时间:2024-03-12 22:57:26 27 4
gpt4 key购买 nike

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

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

解决方法:

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

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com