《Kubernetes故障篇:had untolerated taint node.kubernetes.io/not-ready》

一、环境信息

操作系统 K8S版本 containerd版本
Centos7.6 v1.24.17 v1.6.12

二、背景信息

部署完K8S集群后,使用如下命令测试集群,进入pod中发现无法解析k8s默认域名和无法ping通外网,宿主机主机是可以ping通外网的

bash 复制代码
root@k8s-master-63:~#  kubectl run busybox --image busybox:1.28 --restart=Never --rm -it busybox -- sh
If you don't see a command prompt, try pressing enter.
/ # nslookup kubernetes.default

通过以下命令检查网络插件coredns的状态,发现coredns报错had untolerated taint {node.kubernetes.io/not-ready

bash 复制代码
root@k8s-master-63:~# kubectl describe pods -n kube-system calico-kube-controllers-55fc758c88-s9dtz
Events:
  Type     Reason            Age   From               Message
  ----     ------            ----  ----               -------
  Warning  FailedScheduling  23m   default-scheduler  0/4 nodes are available: 4 node(s) had untolerated taint {node.kubernetes.io/not-ready: }. preemption: 0/4 nodes are available: 4 Preemption is not helpful for scheduling.
  Normal   Scheduled         20m   default-scheduler  Successfully assigned kube-system/coredns-7f74c56694-q8dz6 to k8s-master-63
  Normal   Pulled            20m   kubelet            Container image "registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:v1.8.6" already present on machine
  Normal   Created           20m   kubelet            Created container coredns
  Normal   Started           20m   kubelet            Started container coredns

三、解决方法

报错原因:k8s节点不可调度。

bash 复制代码
# 1、解除调度
kubectl uncordon k8s-master-63
kubectl uncordon k8s-master-64
kubectl uncordon k8s-master-65
kubectl uncordon k8s-worker-66

# 2、删除coredns
kubectl delete pod -n kube-system coredns-7f74c56694-24wql
kubectl delete pod -n kube-system coredns-7f74c56694-hsvpk

如下所示,则表示正常

bash 复制代码
root@k8s-master-63:~# kubectl run busybox --image busybox:1.28 --restart=Never --rm -it busybox -- sh
If you don't see a command prompt, try pressing enter.
/ # nslookup kubernetes.default
Server:    10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local

Name:      kubernetes.default
Address 1: 10.96.0.1 kubernetes.default.svc.cluster.local
/ # 
/ # ping www.baidu.com
PING www.baidu.com (14.119.104.189): 56 data bytes
64 bytes from 14.119.104.189: seq=0 ttl=56 time=18.861 ms
64 bytes from 14.119.104.189: seq=1 ttl=56 time=9.493 ms
64 bytes from 14.119.104.189: seq=2 ttl=56 time=26.687 ms
64 bytes from 14.119.104.189: seq=3 ttl=56 time=25.154 ms

总结:整理不易,如果对你有帮助,可否点赞关注一下?

更多详细内容请参考:企业级K8s集群运维实战

相关推荐
Sagittarius_A*12 小时前
Docker:渗透前置容器化核心基础
运维·安全·docker·容器
成为你的宁宁12 小时前
【Kubernetes集群证书续签】
kubernetes·证书过期
名字还没想好☜15 小时前
Docker 多阶段构建:把镜像从 1.2GB 砍到 15MB
运维·docker·容器·多阶段构建·镜像优化
her_heart15 小时前
ChatGPT 5.6 实战:用 AI 做云成本治理,从账单复盘到 K8s 优化
人工智能·云原生·chatgpt·kubernetes·测试用例
花和满楼15 小时前
K8s 1.36 ImageVolume GA:OCI 镜像不再只能跑容器
java·容器·kubernetes
生活爱好者!16 小时前
NAS还能玩游戏?部署一款 WebGL 3D 赛车小游戏
游戏·docker·容器·玩游戏
DolphinScheduler社区16 小时前
Apache DolphinScheduler 6 月治理优化,补齐调度运维全链路细节
大数据·运维·云原生·apache·海豚调度
hj28625118 小时前
Docker 核心知识点整理(网络 + Dockerfile + 原理 + 命令)
网络·docker·容器
梦想的颜色1 天前
【Docker原理】Docker 容器一文打尽:生命周期、环境管控、迁移备份、日志进程排查、垃圾清理
运维·docker·容器·容器生命周期·容器日志排查·容器迁移备份·容器进程管理