简体   繁体   English

MicroK8s 容器无法启动。 所有 pod 都停留在“ContainerCreating”state 上。 Ubuntu 20.10 RP4

[英]MicroK8s containers unable to start. All pods stuck on "ContainerCreating" state. Ubuntu 20.10 RP4

I've been Googling and going through logs to try and solve this, but I can't seem to get microk8s to work on my Raspberry Pi, running Ubuntu 20.10我一直在谷歌搜索并查看日志以尝试解决这个问题,但我似乎无法让 microk8s 在我的 Raspberry Pi 上运行,运行 Ubuntu 20.10

I snap install v1.15 sudo snap install microk8s --classic --channel=1.15/stable我 snap install v1.15 sudo snap install microk8s --classic --channel=1.15/stable

I can confirm that microk8s.status returns that it is running.我可以确认 microk8s.status 返回它正在运行。 kubectl get nodes --namespace kube-system returns: kubectl get nodes --namespace kube-system 返回:

NAME         STATUS   ROLES    AGE   VERSION
mydnsname   Ready    <none>   22h   v1.15.11 

I have installed the following enabled: dashboard I had dashboard dns ingress - installed but the same issue was present.我安装了以下启用:仪表板我有仪表板 dns 入口 - 已安装但存在相同的问题。

kubectl get all --all-namespaces returns kubectl get all --all-namespaces 返回

NAMESPACE     NAME                                                  READY   STATUS              RESTARTS   AGE
kube-system   pod/heapster-v1.5.2-c4dcfd9f8-kl5g5                   0/4     ContainerCreating   0          68s
kube-system   pod/kubernetes-dashboard-c775bf88b-pmhz6              0/1     ContainerCreating   0          68s
kube-system   pod/monitoring-influxdb-grafana-v4-6f74479987-rd5ck   0/2     ContainerCreating   0          68s


NAMESPACE     NAME                           TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
default       service/kubernetes             ClusterIP   10.152.183.1     <none>        443/TCP             18h
kube-system   service/heapster               ClusterIP   10.152.183.195   <none>        80/TCP              68s
kube-system   service/kubernetes-dashboard   ClusterIP   10.152.183.171   <none>        443/TCP             68s
kube-system   service/monitoring-grafana     ClusterIP   10.152.183.120   <none>        80/TCP              68s
kube-system   service/monitoring-influxdb    ClusterIP   10.152.183.175   <none>        8083/TCP,8086/TCP   68s


NAMESPACE     NAME                                             READY   UP-TO-DATE   AVAILABLE   AGE
kube-system   deployment.apps/heapster-v1.5.2                  0/1     1            0           68s
kube-system   deployment.apps/kubernetes-dashboard             0/1     1            0           68s
kube-system   deployment.apps/monitoring-influxdb-grafana-v4   0/1     1            0           68s

NAMESPACE     NAME                                                        DESIRED   CURRENT   READY   AGE
kube-system   replicaset.apps/heapster-v1.5.2-c4dcfd9f8                   1         1         0       68s
kube-system   replicaset.apps/kubernetes-dashboard-c775bf88b              1         1         0       68s
kube-system   replicaset.apps/monitoring-influxdb-grafana-v4-6f74479987   1         1         0       68s

kubectl describe pods kubernetes-dashboard-c775bf88b-pmhz6 --namespace kube-system returns kubectl describe pods kubernetes-dashboard-c775bf88b-pmhz6 --namespace kube-system 返回

Warning  FailedCreatePodSandBox  2m26s (x3 over 2m54s)   kubelet, mydnsname  (combined from similar events): Failed create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container: failed to create containerd task: failed to mount rootfs component &{overlay overlay [workdir=/var/snap/microk8s/common/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1386/work upperdir=/var/snap/microk8s/common/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1386/fs lowerdir=/var/snap/microk8s/common/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/2/fs]}: invalid argument: unknown
  Warning  MissingClusterDNS       2m14s (x13 over 4m58s)  kubelet, mydnsname  pod: "kubernetes-dashboard-c775bf88b-pmhz6_kube-system(777df7aa-d4de-40f0-8275-70b36d2e5029)". kubelet does not have ClusterDNS IP configured and cannot create Pod using "ClusterFirst" policy. Falling back to "Default" policy.

I have checked and I am not using ZFS as my filesystem for my main partition, I'm using overlayfs df -Th我已经检查过了,我没有使用 ZFS 作为我的主分区的文件系统,我使用的是 overlayfs df -Th

Filesystem     Type     Size  Used Avail Use% Mounted on
none           overlay   59G   21G   36G  37% /
tmpfs          tmpfs    1.9G     0  1.9G   0% /dev/shm
tmpfs          tmpfs    743M  1.2M  742M   1% /run
tmpfs          tmpfs    5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs    4.0M     0  4.0M   0% /sys/fs/cgroup
tmpfs          tmpfs    372M  104K  372M   1% /run/user/1000

Therefore I'm not sure why containerd can't mount or has an issue, considering that containerd doesn't have any issues with overlayfs.因此,考虑到 containerd 对 overlayfs 没有任何问题,我不确定为什么 containerd 无法挂载或出现问题。

Have tried microk8s.reset and uninstalling and reinstalling, and tried a few different versions and still to no avail.已尝试 microk8s.reset 并卸载并重新安装,并尝试了几个不同的版本,但仍然无济于事。

Any ideas or assistance is greatly appreciated as I'm keen to get a local kubernetes setup for local dev!非常感谢任何想法或帮助,因为我渴望为本地开发人员获得本地 kubernetes 设置!

Thanks in advance!提前致谢!

Found the issue was with microk8s, specifically containerd not working with squashFS filesystem with overlay.发现问题出在 microk8s 上,特别是 containerd 不能使用覆盖的 squashFS 文件系统。

The reason for my Ubuntu install using SquashFS was that I was using Berryboot to support multiple OS installations.我使用 SquashFS 安装 Ubuntu 的原因是我使用 Berryboot 来支持多个操作系统安装。

I switched to Pinn, which supports ext4 filesystem, which works with containerd and reinstalled Ubuntu 20.04.我切换到支持 ext4 文件系统的 Pinn,它与 containerd 一起使用并重新安装了 Ubuntu 20.04。

After installing microk8s, the node starts running and containers are all now running correctly.安装 microk8s 后,节点开始运行,容器现在都正常运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM