参考資料
HINFO: unreachable backend: read udp 10.200.0.9:46159->183.60.83.19:53: i/o timeout #2693 (github.com)
kubeadm Hosted Install (projectcalico.org)
About Calico (projectcalico.org)
TL;DR
とりあえずcalico
入れましょう。
kubectl apply -f https://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml
環境情報
- k8s: v1.15.2
- flannel: v0.11.0-amd64
状況
GoogleのDNSサーバ8.8.8.8
へcoredns
がクエリを出して、I/Oタイムアウトになっている。
(下の方は別Pod(ここのredis
)からapt-get
を実行した際に、DNSで名前解決が出来なかった時のログ)
kubectl logs coredns-5c98db65d4-ncvzf -n kube-system
.:53
2019-08-07T07:36:51.802Z [INFO] CoreDNS-1.3.1
2019-08-07T07:36:51.802Z [INFO] linux/amd64, go1.11.4, 6b56a9c
CoreDNS-1.3.1
linux/amd64, go1.11.4, 6b56a9c
2019-08-07T07:36:51.802Z [INFO] plugin/reload: Running configuration MD5 = 5d5369fbc12f985709b924e721217843
2019-08-07T07:36:57.845Z [ERROR] plugin/errors: 2 1047693481524218727.620094442431543579. HINFO: read udp 192.168.122.67:40976->8.8.8.8:53: i/o timeout
...
2019-08-07T07:53:11.277Z [ERROR] plugin/errors: 2 deb.debian.org. A: read udp 192.168.122.67:60325->8.8.8.8:53: i/o timeout
2019-08-07T07:53:11.277Z [ERROR] plugin/errors: 2 security.debian.org. A: read udp 192.168.122.67:35165->8.8.8.8:53: i/o timeout
2019-08-07T07:53:17.315Z [ERROR] plugin/errors: 2 deb.debian.org. A: read udp 192.168.122.67:51408->8.8.8.8:53: i/o timeout
ping
は通る
etcd
のPodに入り、ルータのIPアドレス、GoogleのDNSサーバへping
でパケット送信成功した。どこが問題?
kubectl exec -it etcd-xubuntu -n kube-system -- /bin/sh
ping <router_ip_address>
...
ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=52 time=19.037 ms
coredns
に他PodからDNS要求されているか
※これは今回の件と関係ないが一応のチェック
etcd
の/etc/resolv.conf
でDNSサーバのIPアドレスを見てみる・・・10.96.0.10
がDNSサーバね
cat /etc/resolv.conf
nameserver 10.96.0.10
search default.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
coredns
のサービス状態も見てみる・・・etcd
が持ってるIPアドレスと一致した
(apt-get
を実行したredis
でも一致)
kubectl get svc --namespace=kube-system
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kube-dns ClusterIP 10.96.0.10 <none> 53/UDP,53/TCP,9153/TCP 46m
解決
HINFO: unreachable backend: read udp 10.200.0.9:46159->183.60.83.19:53: i/o timeout #2693 (github.com)
のコメントにある通り、calico
を使ってみる
kubectl apply -f https://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml
configmap/calico-config created
daemonset.extensions/calico-etcd created
service/calico-etcd created
daemonset.extensions/calico-node created
deployment.extensions/calico-kube-controllers created
clusterrolebinding.rbac.authorization.k8s.io/calico-cni-plugin created
clusterrole.rbac.authorization.k8s.io/calico-cni-plugin created
serviceaccount/calico-cni-plugin created
clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
serviceaccount/calico-kube-controllers created
全部のPodがn/n Running
になるのを待ち、redis
に入って
kubectl exec -it redis -- /bin/bash
apt-get
を実行したら、成功した。
apt-get update
Hit:1 http://security-cdn.debian.org/debian-security buster/updates InRelease
Hit:2 http://cdn-fastly.deb.debian.org/debian buster InRelease
Hit:3 http://cdn-fastly.deb.debian.org/debian buster-updates InRelease
Reading package lists... Done
calico
って?
About Calico (projectcalico.org)
CNI(Container Networking Interface)の実装でした。
元々flannel
でCNIを担ってたんですが、設定がマズイのかflannel
だとcoredns
がきちんと動かなかったようです。。
原因自体にたどり着いていないので消化不良ですが、今回は調査終了します。