Microk8s中的Pod在Ubuntu上保持待定状态

4

我已经在互联网上寻找解决方案,但没有找到有用的东西。我有一个托管的服务器,运行着Ubuntu 18.04。Pods始终处于挂起状态,不想运行。

NAMESPACE            NAME                                                  READY   STATUS    RESTARTS   AGE
container-registry   pod/registry-7cf58dcdcc-hf8gx                         0/1     Pending   0          12m
kube-system          pod/coredns-588fd544bf-4m6mj                          0/1     Pending   0          12m
kube-system          pod/dashboard-metrics-scraper-db65b9c6f-gj5x4         0/1     Pending   0          12m
kube-system          pod/heapster-v1.5.2-58fdbb6f4d-q6plc                  0/4     Pending   0          12m
kube-system          pod/hostpath-provisioner-75fdc8fccd-6mdvc             0/1     Pending   0          12m
kube-system          pod/kubernetes-dashboard-67765b55f5-8xsh5             0/1     Pending   0          12m
kube-system          pod/monitoring-influxdb-grafana-v4-6dc675bf8c-82fg4   0/2     Pending   0          12m

当我输入 mickrok8s.kubectl describe nodes 时,我得到了以下输出...
 Normal   Starting                 15s    kubelet, h2860142.stratoserver.net     Starting kubelet.
  Warning  InvalidDiskCapacity      15s    kubelet, h2860142.stratoserver.net     invalid capacity 0 on image filesystem
  Normal   NodeHasSufficientPID     15s    kubelet, h2860142.stratoserver.net     Node h2860142.stratoserver.net status is now: NodeHasSufficientPID
  Normal   NodeHasNoDiskPressure    15s    kubelet, h2860142.stratoserver.net     Node h2860142.stratoserver.net status is now: NodeHasNoDiskPressure
  Normal   NodeHasSufficientMemory  15s    kubelet, h2860142.stratoserver.net     Node h2860142.stratoserver.net status is now: NodeHasSufficientMemory
  Normal   NodeHasSufficientPID     3s     kubelet, h2860142.stratoserver.net     Node h2860142.stratoserver.net status is now: NodeHasSufficientPID

“microk8s.kubectl get nodes -o wide”命令的输出结果...
NAME                        STATUS     ROLES    AGE   VERSION   INTERNAL-IP     EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
h2860142.stratoserver.net   NotReady   <none>   23h   v1.18.3   85.214.165.16   <none>        Ubuntu 18.04.4 LTS   4.15.0           containerd://1.2.5

microk8s.kubectl get pods -A的输出结果:

NAMESPACE            NAME                                              READY   STATUS    RESTARTS   AGE
container-registry   registry-7cf58dcdcc-hf8gx                         0/1     Pending   0          63m
kube-system          coredns-588fd544bf-4m6mj                          0/1     Pending   0          63m
kube-system          dashboard-metrics-scraper-db65b9c6f-gj5x4         0/1     Pending   0          63m
kube-system          heapster-v1.5.2-58fdbb6f4d-q6plc                  0/4     Pending   0          63m
kube-system          hostpath-provisioner-75fdc8fccd-6mdvc             0/1     Pending   0          63m
kube-system          kubernetes-dashboard-67765b55f5-8xsh5             0/1     Pending   0          63m
kube-system          monitoring-influxdb-grafana-v4-6dc675bf8c-82fg4   0/2     Pending   0          63m

"microk8s.inspect" 的输出结果

Inspecting Certificates                                                                
Inspecting services                                                                    
  Service snap.microk8s.daemon-cluster-agent is running                                
  Service snap.microk8s.daemon-flanneld is running                                     
  Service snap.microk8s.daemon-containerd is running                                   
  Service snap.microk8s.daemon-apiserver is running                                    
  Service snap.microk8s.daemon-apiserver-kicker is running                             
  Service snap.microk8s.daemon-proxy is running                                        
  Service snap.microk8s.daemon-kubelet is running                                      
  Service snap.microk8s.daemon-scheduler is running                                    
  Service snap.microk8s.daemon-controller-manager is running                           
  Service snap.microk8s.daemon-etcd is running                                         
  Copy service arguments to the final report tarball                                   
Inspecting AppArmor configuration                                                      
Gathering system information                                                           
  Copy processes list to the final report tarball                                      
  Copy snap list to the final report tarball                                           
  Copy VM name (or none) to the final report tarball                                   
  Copy disk usage information to the final report tarball                              
  Copy memory usage information to the final report tarball                            
  Copy server uptime to the final report tarball                                       
  Copy current linux distribution to the final report tarball                          
  Copy openSSL information to the final report tarball                                 
  Copy network configuration to the final report tarball                               
Inspecting kubernetes cluster                                                          
  Inspect kubernetes cluster                                                           

Building the report tarball                                                            
  Report tarball is at /var/snap/microk8s/1422/inspection-report-20200609_120308.tar.gz

那么我该如何解决这个问题?

谢谢 :)


1
共享mickrok8s.kubectl get nodes -o wide和mickrok8s.kubectl get events的输出。 - Arghya Sadhu
请编辑问题并在那里添加。 - Arghya Sadhu
“get events” 的输出与 “describe nodes” 相同。在 “get nodes -o wide”的输出之上。 - volkanb
请分享节点上的kubelet日志。 - Arghya Sadhu
你是否启用了 storage?你可以通过运行 microk8s.status 命令来检查。 - Griffin
显示剩余11条评论
2个回答

0

关于此事,文档中有一节。

如果 Pod 处于 Pending 状态,则意味着它无法被调度到节点上。通常这是因为某种类型的资源不足而导致无法调度。查看 kubectl describe 的输出...

在我的情况下,kubectl describe pods <podname> 显示:

Events:
  Type     Reason            Age                  From               Message
  ----     ------            ----                 ----               -------
  Warning  FailedScheduling  6m1s (x3 over 7m6s)  default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.

搜索那个警告给了我所需的信息。希望你也能在那里找到有用的警告。


0

你的Ubuntu安装可能已禁用cgroups。例如,如果你在树莓派上运行,cgroups默认是禁用的。

microk8s需要cgroups才能正常工作。

你可能想按照这里描述的方法启用cgroups:

invalid capacity 0 on image filesystem - Not ZFS


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接