kubernete 安装常见问题汇总
更新:HHH   时间:2023-1-7


1、Sep 15 18:22:07 k8s-node1 kubelet: E0915 18:22:07.628384 12912 summary.go:102] Failed to get system container stats for "/system.slice/kubelet.service": failed to get cgroup stats for "/system.slice/kubelet.service": failed to get container info for "/system.slice/kubelet.service": unknown container "/system.slice/kubelet.service

docker需要重启


2、
[discovery] Failed to request cluster info, will try again: [Get https://192.168.1.112:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: x509: certificate has expired or is not yet valid

单节点加入时区不对,需要ntpupdate 下时间 ntpdate 182.92.12.11


3、
如果kubectl get nodes 有节点状态是not ready 状态,可重启该节点的docker

执行kubectl get nodes 提示如下:
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
解决办法,记的kubeadm reset会删除:


4、
error: open /var/lib/kubelet/config.yaml: no such file or directory
关键文件缺失,多发生于没有做 kubeadm init就运行了systemctl start kubelet


5、
kubeadm init --apiserver-advertise-address=192.168.11.12 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.13.4 --pod-network-cidr=10.244.0.0/16
kubernete v1.13.4可以指定源进行安装


6、
kubernete v1.13.4 支持docker-ce-18.06.3.ce-3.el7.x86_64


7、
kubectl get pod --all-namespaces -o wide  
保证集群进入running 状态后再查看集群状态,否则可能不正常.这需要几分钟


8、
swapoff | #/dev/mapper/centos-swap swap swap defaults 0 0
关闭swap交换分区,交换分区技术现在基本没人用


9、kubeadm 重置命令,kubeadm reset,这个会反复用到


10、
kubectl drain node2 --delete-local-data --force --ignore-daemonsets
kubectl delete node node2
kubeadm join 192.168.11.12:6443 --token vabefc.eilf71g7y96twbyz --discovery-token-ca-cert-hash sha256:4e6f2149e6488be130611ccc92137cdaf7a3c64a919c4454604f9857d51453a7
集群加入节点,删除节点


#k8s问题汇总
https://blog.csdn.net/qq_34857250/article/details/82562514

返回云计算教程...