Jenkins Pod处于Pending状态排障请求:FailedScheduling异常
Jenkins Pod Pending状态问题根源分析
根据你提供的调度警告信息和配置文件,问题根源可拆解为以下核心点,结合你的3个master节点环境逐一说明:
1. 单个节点Pod数量超限
警告中1 Too many pods说明有一个节点已达到Kubernetes允许的最大Pod数量上限。可通过以下命令验证:
# 检查每个节点的Pod使用量与上限 kubectl describe node k8sc2m1 | grep -A 6 "Allocated resources" kubectl describe node k8sc2m2 | grep -A 6 "Allocated resources" kubectl describe node k8sc2m3 | grep -A 6 "Allocated resources"
查看输出里的Pods行,若Used值等于Hard值,说明该节点Pod配额已饱和。
2. Master节点污点与Pod容忍不匹配(核心原因)
你的集群所有节点均为control-plane,master角色,Kubernetes默认会给master节点添加污点:
node-role.kubernetes.io/master:NoSchedule
该污点会阻止普通Pod调度到master节点,但你的Jenkins StatefulSet Pod模板未配置对应容忍规则,导致另外2个master节点无法被调度选中。
验证节点污点的命令:
kubectl describe node k8sc2m2 | grep Taints kubectl describe node k8sc2m3 | grep Taints
额外排查点
虽然调度警告未提及,但需确认存储资源是否正常:
- 检查
jenkins-storage存储类是否存在:kubectl get storageclasses - 检查Jenkins对应的PVC是否创建成功:
kubectl get pvc -n jenkins
临时解决方向
- 给Jenkins StatefulSet添加master节点容忍,允许Pod调度到master节点:
在StatefulSet的spec.template.spec下添加:tolerations: - key: "node-role.kubernetes.io/master" operator: "Exists" effect: "NoSchedule" - 清理超限节点上的无用Pod释放配额;或调整节点
maxPods参数(需重启节点)
内容的提问来源于stack exchange,提问作者Breaking News
相关产品推荐
相关产品推荐

