执行Kubectl describe得到的错误信息:
#kubectl describe pod etcd-test-1000 --namespace=docker--test
Name: etcd-test-1000
Namespace: docker--test
Node: /
Labels:
Status: Pending
IP:
Controllers:
Containers:
etcd-test-74000:
Image: 192.168.0.76:5000/etcd:2.2.1
Port:
Command:
/usr/local/bin/etcd
-data-dir
/var/etcd/data
-listen-client-urls
http://127.0.0.1:2379,http://127.0.0.1:4001
-advertise-client-urls
http://127.0.0.1:2379,http://127.0.0.1:4001
-initial-cluster-token
skydns-etcd
QoS Tier:
memory: Burstable
cpu: Burstable
Requests:
cpu: 1500m
memory: 50Mi
Environment Variables:
No volumes.
Events:
FirstSeen LastSeen Count From SubobjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
2h 16s 558 {default-scheduler } Warning FailedScheduling pod (etcd-test-1000) failed to fit in any node
fit failure on node (kube-node79): Node didn't have enough resource: CPU, requested: 1500, used: 1500, capacity: 2000
日志里的错误信息:
Mar 6 14:31:30 kube-master74 kube-scheduler: I0306 14:31:30.155364 20546 event.go:211] Event(api.ObjectReference{Kind:"Pod", Namespace:"docker--test", Name:"etcd-test-1000", UID:"c0cfe539-0220-11e7-b425-525400eb78bc", APIVersion:"v1", ResourceVersion:"5077469", FieldPath:""}): type: 'Warning' reason: 'FailedScheduling' pod (etcd-test-1000) failed to fit in any node
Mar 6 14:31:30 kube-master74 kube-scheduler: fit failure on node (kube-node79): Node didn't have enough resource: CPU, requested: 1500, used: 1500, capacity: 2000
Mar 6 14:31:38 kube-master74 kube-scheduler: E0306 14:31:38.159416 20546 factory.go:355] Error scheduling docker--test etcd-test-1000: pod (etcd-test-1000) failed to fit in any node
Mar 6 14:31:38 kube-master74 kube-scheduler: fit failure on node (kube-node79): Node didn't have enough resource: CPU, requested: 1500, used: 1500, capacity: 2000
Mar 6 14:31:38 kube-master74 kube-scheduler: ; retrying
代码分析:
plugin/pkg/scheduler/algorithm/predicates/predicates.go
PodFitsResources
plugin/pkg/scheduler/schedulercache/node_info.go
addPod
calculateResource