k8s的bug汇总,长期更新ing
记录k8s一些频繁出现的bug,会一直更新的。
·
(我的其他文章有详细的k8s安装包含docker安装部署,以及KubeEdge安装部署,有兴趣可以去看看)
记录k8s,kubeedge,docker一些频繁出现的bug,会一直更新的
一:cordns为pending时(master服务器)
答:1.kubeadm初始化(192.168.40.4改成自己master的ip)
kubeadm init --apiserver-advertise-address=192.168.40.4 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.10.0 --service-cidr=10.96.0.0/20 --pod-network-cidr=10.244.0.0/16
2.fannel重新安装
kubectl apply -f kube-flannel.yml
二:kube-controller-manager一直重启(master服务器)
答:打开这个文件
改成:leader-elect=false
问题解决
三:重启node服务器,node重新加入master节点报错(node服务器)
答:首先重置:
kubeadm reset
然后重新加入:(ip,token,hash记得改成自己的master的)
kubeadm join 192.168.40.4:6443 --token q0nk7k.vnflihowd7g1zn0l --discovery-token-ca-cert-hash sha256:51dc9556514c59f247af539a8ebca9d3a2fcd865fef1e21932b7b1384b7326fc
成功:
四:每次重启master服务器后,DNS服务器配置文件\etc\resolv.conf被自动重置
答:锁定resolv.conf
sudo chattr +i /etc/resolv.conf
解决
五:master服务器安装kubeedge的错误(master服务器)
答:这个是缺少crud文件
缺少哪个下载哪个放到kubeedge里面去
下载位置:
https://github.com/kubeedge/kubeedge/tree/master/build/crds
放到相对应的三个文件夹:
六:k8s安装fannel网络插件报错(master服务器)
我的k8s是1.22.0版本。原因是fannel.yml版本过低
问题的原因为资源文件的版本定义过期了。需要修改下把rbac.authorization.k8s.io/v1beta1
替换成rbac.authorization.k8s.io/v1 即可. DaemonSet由extensions/v1beta1变成了apps/v1,新增了selector
然后重启
systemctl stop kubelet
systemctl stop docker
iptables --flush
iptables -tnat --flush
systemctl start kubelet
systemctl start docker
ok了
七:早上一起来发现fanel报错error(master服务器)
先打日志看看:
kubectl -n kube-system logs kube-flannel-ds-amd64-ksf5q
发现错误:
192.168.40.4 是 kubeedge的edge端服务器
试试端口能访问不:
大概知道了,edge防火墙的问题,查看防火墙
edge端执行关闭防火墙命令:
systemctl stop firewalld.service
永久关闭防火墙:
systemctl status firewalld.service
八:重启kubeedge的edge服务器,发现报错:(edge服务器)
解决:
查看edge日志
1.删掉crt:
[root@edge1 /]# cd etc/kubeedge/
[root@edge1 kubeedge]# ll
total 55432
drwxr-xr-x. 2 root root 24 Aug 6 16:58 ca
drwxr-xr-x. 2 root root 42 Aug 6 16:58 certs
-rw-r--r--. 1 root root 129 Aug 6 16:56 checksum_kubeedge-v1.10.0-linux-amd64.tar.gz.txt
drwxr-xr-x. 2 root root 27 Aug 6 16:58 config
drwxr-xr-x. 5 root root 56 Aug 6 16:56 crds
-rw-r--r--. 2 root root 160 Aug 6 16:56 edgecore.service
drwxr-xr-x. 4 root root 46 Mar 14 10:30 kubeedge-v1.10.0-linux-amd64
-rw-r--r--. 1 root root 56751052 Aug 6 16:56 kubeedge-v1.10.0-linux-amd64.tar.gz
[root@edge1 kubeedge]# cd ca
[root@edge1 ca]# ll
total 4
-rw-r--r--. 1 root root 570 Aug 6 16:58 rootCA.crt
[root@edge1 ca]# rm rootCA.crt
rm: remove regular file ‘rootCA.crt’? y
[root@edge1 ca]# ll
total 0
2.删掉edgecore.service然后重新部署edge
[root@edge1 ca]# systemctl stop edgecore
[root@edge1 ca]# rm /etc/systemd/system/edgecore.service
rm: remove regular file ‘/etc/systemd/system/edgecore.service’? y
成功:
beedge-version=1.10.0 join --cloudcore-ipport=192.168.40.2:10000 --token=2f1a49408d8a2542026faacac1ac0d81ab3b354506e25c20273cdc033c9f5a94.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NjAwMTI3MzR9.-MMDBAOxiL5P9KESCcf5191y9gOnhFraQ641LOmbPGQ --kb
Host has /usr/sbin/mosquitto already installed and running. Hence skipping the installation steps !!!
Expected or Default KubeEdge version 1.10.0 is already downloaded and will checksum for it.
kubeedge-v1.10.0-linux-amd64.tar.gz checksum:
checksum_kubeedge-v1.10.0-linux-amd64.tar.gz.txt content:
Expected or Default checksum file checksum_kubeedge-v1.10.0-linux-amd64.tar.gz.txt is already downloaded.
Expected or Default KubeEdge version 1.10.0 is already downloaded
[Run as service] service file already exisits in /etc/kubeedge//edgecore.service, skip download
kubeedge-v1.10.0-linux-amd64/
kubeedge-v1.10.0-linux-amd64/cloud/
kubeedge-v1.10.0-linux-amd64/cloud/cloudcore/
kubeedge-v1.10.0-linux-amd64/cloud/cloudcore/cloudcore
kubeedge-v1.10.0-linux-amd64/cloud/iptablesmanager/
kubeedge-v1.10.0-linux-amd64/cloud/iptablesmanager/iptablesmanager
kubeedge-v1.10.0-linux-amd64/cloud/csidriver/
kubeedge-v1.10.0-linux-amd64/cloud/csidriver/csidriver
kubeedge-v1.10.0-linux-amd64/cloud/admission/
kubeedge-v1.10.0-linux-amd64/cloud/admission/admission
kubeedge-v1.10.0-linux-amd64/edge/
kubeedge-v1.10.0-linux-amd64/edge/edgecore
kubeedge-v1.10.0-linux-amd64/version
KubeEdge edgecore is running, For logs visit: journalctl -u edgecore.service -xe
更多推荐
已为社区贡献2条内容
所有评论(0)