Kubernetes kube-dns pod正在申请中

Lak*_*age 6 ubuntu kubernetes ubuntu-16.04 kubeadm

我试过这个doc在Ubuntu VM中安装和设置Kubernetes.我已经完成了3/4,现在kube-dns pod处于待定状态.我怎么能弄清楚这个?这里是结果kubectl get pods --namespace=kube-systemkubectl describe pod <pod name>

# kubectl get pods --namespace=kube-system
NAME                              READY     STATUS    RESTARTS   AGE
dummy-2088944543-jk2t2            1/1       Running   0          3h
etcd-ubuntu                       1/1       Running   0          3h
kube-apiserver-ubuntu             1/1       Running   0          3h
kube-controller-manager-ubuntu    1/1       Running   0          3h
kube-discovery-1769846148-h88v4   1/1       Running   0          3h
kube-dns-2924299975-dfp17         0/4       Pending   0          3h
kube-proxy-zdcxw                  1/1       Running   0          3h
kube-scheduler-ubuntu             1/1       Running   0          3h
weave-net-xwfhj                   2/2       Running   0          2h

# kubectl describe pod kube-dns-2924299975-dfp17
Error from server (NotFound): pods "kube-dns-2924299975-dfp17" not found
Run Code Online (Sandbox Code Playgroud)

Ant*_*ten 16

原因

很可能是您的群集中缺少可用的计算资源.

如果您正在使用cluster/addons/dns中的示例,那么您肯定使用Deploymentwith资源请求,如果单击该链接则会突出显示.可能是您的其他pod已经在请求群集中的所有可用资源,因此您的pod不会被安排.

您可以kubectl --namespace=kube-system describe pod kube-dns-2924299975-dfp17通过以下方式确认该理论,并查看以下事件:

Reason                Message
------                -------
FailedScheduling      pod (kube-dns-2924299975-dfp17) failed to fit in any node
fit failure summary on nodes : Insufficient cpu (3)
Run Code Online (Sandbox Code Playgroud)

您还可以使用并描述kubectl describe node <node-name>最后的信息来描述您的节点:

Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.
  CPU Requests  CPU Limits      Memory Requests Memory Limits
  ------------  ----------      --------------- -------------
  320m (8%)     300m (7%)       150Mi (1%)      150Mi (1%)
Run Code Online (Sandbox Code Playgroud)

在您的情况下,CPU或内存分配应接近100%.

  • 向群集添加更多计算资源/节点(首选)
  • 从您的pod中删除资源请求,但存在过度使用资源的风险