I have setup kubernetes
in ubuntu 16.04
. I am using kube version 1.13.1
and using weave for networking. I have initialized the cluster using :
sudo kubeadm init --token-ttl=0 --apiserver-advertise-address=192.168.88.142
and weave:
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
All the pods seems to be running fine but coredns
always remains in CrashLoopBackOff
status. I have read mostly all the solution available for this.
NAME READY STATUS RESTARTS AGE
coredns-86c58d9df4-h5plc 0/1 CrashLoopBackOff 7 18m
coredns-86c58d9df4-l77rw 0/1 CrashLoopBackOff 7 18m
etcd-tx-g1-209 1/1 Running 0 17m
kube-apiserver-tx-g1-209 1/1 Running 0 17m
kube-controller-manager-tx-g1-209 1/1 Running 0 17m
kube-proxy-2jdpp 1/1 Running 0 18m
kube-scheduler-tx-g1-209 1/1 Running 0 17m
weave-net-npgnc 2/2 Running 0 13m
I initially started by editing the cordens file and deleting the loop. It resolves the issue but then later I realized that I wasn't able to ping www.google.com
from within the container but I was able to ping the ip address of google.com. Thus deleting the loop is not a perfect solution.
Next I tried looking at the /etc/resolv.conf
and found below contents:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
search APSDC.local
Here is the workaround provided on kubernetes page which says that any type IP address like 127.0.0.1 should be avoided. I am not able to understand this line as this file is automatically generated. How can make changes to the file so that coredns can work fine. Belo is the logs of coredns:
$ kubectl logs coredns-86c58d9df4-h5plc -n kube-system
.:53
2019-01-31T17:26:43.665Z [INFO] CoreDNS-1.2.6
2019-01-31T17:26:43.666Z [INFO] linux/amd64, go1.11.2, 756749c
CoreDNS-1.2.6
linux/amd64, go1.11.2, 756749c
[INFO] plugin/reload: Running configuration MD5 = f65c4821c8a9b7b5eb30fa4fbc167769
[FATAL] plugin/loop: Forwarding loop detected in "." zone. Exiting. See https://coredns.io/plugins/loop#troubleshooting. Probe query: "HINFO 1423429973721138313.4523734933111484351.".
Can anyone please point me to right direction in order to resolve this issue. Please help. Thanks