微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

microk8s pod 在我的 raspberry pi ubuntu 上频繁重启

如何解决microk8s pod 在我的 raspberry pi ubuntu 上频繁重启

我在 raspBerry pi 4 上安装了 64 位 ubuntu,在我看来,每个 pod 都频繁重启:

microk8s.kubectl describe pod redis-c49fd5d65-g8ghn
Name:         redis-c49fd5d65-g8ghn
Namespace:    default
Priority:     0
Node:         raspBerrypi4-docker1/192.168.0.45
Start Time:   Thu,10 Sep 2020 08:11:38 +0000
Labels:       app=redis
              pod-template-hash=c49fd5d65
Annotations:  <none>
Status:       Running
IP:           10.1.42.201
IPs:
  IP:           10.1.42.201
Controlled By:  replicaset/redis-c49fd5d65
Containers:
  redis:
    Container ID:   containerd://9b8300e456691025ccbfbee588a52069a1fa25ffa6f0c1b5f5f652227a1172f3
    Image:          hypriot/rpi-redis:latest
    Image ID:       sha256:2e0128f189c5b19a15001e48fac1d0326326cebb4195abf6a56519e374636f1f
    Port:           6379/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Sun,07 Mar 2021 10:15:57 +0000
    Last State:     Terminated
      Reason:       UnkNown
      Exit Code:    255
      Started:      Sun,07 Mar 2021 09:24:16 +0000
      Finished:     Sun,07 Mar 2021 10:14:43 +0000
    Ready:          True
    Restart Count:  4579
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-dn4bk (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  default-token-dn4bk:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-dn4bk
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason          Age                    From     Message
  ----     ------          ----                   ----     -------
  normal   SandBoxChanged  8d                     kubelet  Pod sandBox changed,it will be killed and re-created.
  normal   SandBoxChanged  8d                     kubelet  Pod sandBox changed,it will be killed and re-created.
  normal   Pulled          8d                     kubelet  Container image "hypriot/rpi-redis:latest" already present on machine
  normal   Created         8d                     kubelet  Created container redis
  normal   Started         8d                     kubelet  Started container redis
  normal   SandBoxChanged  8d                     kubelet  Pod sandBox changed,it will be killed and re-created.
  normal   Pulled          8d                     kubelet  Container image "hypriot/rpi-redis:latest" already present on machine
  normal   Created         8d                     kubelet  Created container redis
  normal   Started         8d                     kubelet  Started container redis

...
  normal   SandBoxChanged  108m                   kubelet  Pod sandBox changed,it will be killed and re-created.
  normal   Pulled          107m                   kubelet  Container image "hypriot/rpi-redis:latest" already present on machine
  normal   Created         107m                   kubelet  Created container redis
  normal   Started         107m                   kubelet  Started container redis
  normal   SandBoxChanged  101m                   kubelet  Pod sandBox changed,it will be killed and re-created.
  normal   Pulled          101m                   kubelet  Container image "hypriot/rpi-redis:latest" already present on machine
  normal   Created         101m                   kubelet  Created container redis
  normal   Started         101m                   kubelet  Started container redis
  normal   SandBoxChanged  49m                    kubelet  Pod sandBox changed,it will be killed and re-created.
  normal   Pulled          49m                    kubelet  Container image "hypriot/rpi-redis:latest" already present on machine
  normal   Started         49m                    kubelet  Started container redis
  normal   Created         49m                    kubelet  Created container redis

我已经读到这个错误可能是网络故障的结果,我可以在我的 journalctl 日志中找到一条 DNS 错误消息:

Mar 07 11:24:52 raspBerrypi4-docker1 systemd-resolved[1760]: Server returned error NXDOMAIN,mitigating potential DNS violation DVE-2018-0001,retrying transaction with reduced feature level UDP.
Mar 07 11:24:52 raspBerrypi4-docker1 systemd-resolved[1760]: Server returned error NXDOMAIN,retrying transaction with reduced feature level UDP.
Mar 07 11:24:55 raspBerrypi4-docker1 microk8s.daemon-kubelet[4953]: E0307 11:24:55.190320    4953 summary_sys_containers.go:47] Failed to get system container stats for "/systemd/system.slice": Failed to get cgroup stats for "/systemd/system.slice": Failed to get container info for "/systemd/system.slice": unkNown container "/systemd/system.slice"

Microk8s 检查输出

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/2038/inspection-report-20210307_113359.tar.gz

如何防止容器重启?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。