0

I have installed a microk8s on my 64 bit raspbian, and enabled a dns server by

microk8s enable dns

Coredns is continously cashes:

microk8s.kubectl describe pod coredns-64c6478b6c-snkxx --namespace=kube-system

Namespace:            kube-system
Priority:             2000000000
Priority Class Name:  system-cluster-critical
Node:                 raspberrypi4-docker3/192.168.0.129
Start Time:           Fri, 12 Aug 2022 18:28:54 +0200
Labels:               k8s-app=kube-dns
                      pod-template-hash=64c6478b6c
Annotations:          cni.projectcalico.org/podIP: 10.1.174.245/32
                      cni.projectcalico.org/podIPs: 10.1.174.245/32
                      priorityClassName: system-cluster-critical
Status:               Running
IP:                   10.1.174.245
IPs:
  IP:           10.1.174.245
Controlled By:  ReplicaSet/coredns-64c6478b6c
Containers:
  coredns:
    Container ID:  containerd://194f8be3d70a7141148c63d2dd92c24e47e40af6c0fdb6d582885a60d38d8e62
    Image:         coredns/coredns:1.8.0
    Image ID:      docker.io/coredns/coredns@sha256:cc8fb77bc2a0541949d1d9320a641b82fd392b0d3d8145469ca4709ae769980e
    Ports:         53/UDP, 53/TCP, 9153/TCP
    Host Ports:    0/UDP, 0/TCP, 0/TCP
    Args:
      -conf
      /etc/coredns/Corefile
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       StartError
      Message:      failed to create containerd task: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: openat2 /sys/fs/cgroup/kubepods/burstable/podfb1a1616-e10f-4916-9df8-160a92cf4340/194f8be3d70a7141148c63d2dd92c24e47e40af6c0fdb6d582885a60d38d8e62/memory.max: no such file or directory: unknown
      Exit Code:    128
      Started:      Thu, 01 Jan 1970 01:00:00 +0100
      Finished:     Fri, 12 Aug 2022 18:32:26 +0200
    Ready:          False
    Restart Count:  6
    Limits:
      memory:  170Mi
    Requests:
      cpu:        100m
      memory:     70Mi
    Liveness:     http-get http://:8080/health delay=60s timeout=5s period=10s #success=1 #failure=5
    Readiness:    http-get http://:8181/ready delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:  <none>
    Mounts:
      /etc/coredns from config-volume (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-hs9ph (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  config-volume:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      coredns
    Optional:  false
  kube-api-access-hs9ph:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              <none>
Tolerations:                 CriticalAddonsOnly op=Exists
                             node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason     Age                     From               Message
  ----     ------     ----                    ----               -------
  Normal   Scheduled  4m42s                   default-scheduler  Successfully assigned kube-system/coredns-64c6478b6c-snkxx to raspberrypi4-docker3
  Normal   Pulled     4m41s (x2 over 4m42s)   kubelet            Container image "coredns/coredns:1.8.0" already present on machine
  Normal   Created    4m41s (x2 over 4m42s)   kubelet            Created container coredns
  Warning  Failed     4m41s (x2 over 4m42s)   kubelet            Error: failed to create containerd task: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: openat2 /sys/fs/cgroup/kubepods/burstable/podfb1a1616-e10f-4916-9df8-160a92cf4340/coredns/memory.max: no such file or directory: unknown
  Warning  BackOff    4m39s (x2 over 4m40s)   kubelet            Back-off restarting failed container
  Normal   Pulled     2m32s (x4 over 3m51s)   kubelet            Container image "coredns/coredns:1.8.0" already present on machine
  Normal   Created    2m32s (x4 over 3m51s)   kubelet            Created container coredns
  Warning  Failed     2m32s (x4 over 3m51s)   kubelet            Error: failed to create containerd task: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: process_linux.go:508: setting cgroup config for procHooks process caused: openat2 /sys/fs/cgroup/kubepods/burstable/podfb1a1616-e10f-4916-9df8-160a92cf4340/coredns/memory.max: no such file or directory: unknown
  Warning  BackOff    2m30s (x13 over 3m51s)  kubelet            Back-off restarting failed container

How can I solve this CrashLoopBackOff problem?

1 Answer 1

0

I have solved the coredns problem by running

sudo sed -i '$ s/$/ cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1/' /boot/cmdline.txt

in my raspbian.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.