k8s无法进入容器报错和解决方法
如报错:Error from server: error dialing backend: dial tcp: lookup k8s-node2 on 8.8.8.8:53: no such hostError from server: error dialing backend: dial tcp 192.168.2.192:10250: connect: connection refused此
如报错:
Error from server: error dialing backend: dial tcp: lookup k8s-node2 on 8.8.8.8:53: no such host
Error from server: error dialing backend: dial tcp 192.168.2.192:10250: connect: connection refused
此故障是hosts文件解析名称和节点主机名称,以及配置文件kube-proxy.kubeconfig不一致所导致此问题
#配置文件kube-proxy.kubeconfig里面此名称hostnameOverride: k8s-node01和主机名称不一致
kind: KubeProxyConfiguration
apiVersion: kubeproxy.config.k8s.io/v1alpha1
address: 0.0.0.0
metricsBindAddress: 0.0.0.0:10249
clientConnection:
kubeconfig: /opt/kubernetes/cfg/kube-proxy.kubeconfig
hostnameOverride: k8s-node01
clusterCIDR: 10.0.0.0/24
mode: ipvs
ipvs:
scheduler: “rr”
iptables:
masqueradeAll: true
~
#修改hosts解析
192.168.2.190 k8s-master
192.168.2.191 k8s-node1
192.168.2.192 k8s-node2
192.168.2.193 k8s-node3
#修改主机名称
hostnamectl set-hostname k8s-master
hostnamectl set-hostname k8s-node1
hostnamectl set-hostname k8s-node2
hostnamectl set-hostname k8s-node3
#重启node节点的组件
systemctl restart kubelet
systemctl restart kube-proxy
YYQ运维技术博客_运维的工作学习之路
https://www.yeyouqing.top
https://yeyouqing.top
yeyouqing.top
www.yeyouqing.top
更多推荐
所有评论(0)