kubernetes cluster on raspberry pi 4- coredns problem

1/17/2020

I'm having problems getting a kubernetes cluster setup on raspberry pi 4.

I'm unable to get internet access from inside the pods

I'm trying to use flannel

I have the same setup working on a raspberry pi 3, without problems so I don't think there's anything wrong with my network.

The problem appears to be with coredns, the logs show the following:

pi@rpi4-reg:~ $ kubectl -n kube-system logs coredns-6955765f44-wvsz4
.:53
[INFO] plugin/reload: Running configuration MD5 = 4e235fcc3696966e76816bcd9034ebc7
CoreDNS-1.6.5
linux/arm, go1.13.4, c2fd1b2
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:41212->4.2.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:33647->192.168.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:33755->4.2.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:55151->192.168.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:50820->4.2.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:56227->192.168.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:48078->192.168.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:52120->192.168.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:48378->192.168.2.1:53: i/o timeout
[ERROR] plugin/errors: 2 1228749791.1011458686. HINFO: read udp 10.244.0.3:59986->192.168.2.1:53: i/o timeout

The coredns config file

apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health {
           lameduck 5s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
           ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
metadata:
  creationTimestamp: "2020-01-17T08:26:29Z"
  name: coredns
  namespace: kube-system
  resourceVersion: "188"
  selfLink: /api/v1/namespaces/kube-system/configmaps/coredns
  uid: 287d7906-f126-4fd3-8937-b98cf9ea8833

resolv.conf

nameserver 4.2.2.1
nameserver 192.168.2.1
-- ceharep
coredns
kubernetes

1 Answer

1/25/2020

Please try to execute this command

$ sudo update-alternatives --set iptables /usr/sbin/iptables-legacy

and reboot, try setup k8s cluseter again

-- sminamot
Source: StackOverflow