Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Kubernetes Error: coredns – no route to host log & Failed to list & CrashLoopBackOff

Errors


[verizon@raj-laptop ~]$ kubectl get pods -A
NAMESPACE     NAME                                 READY   STATUS             RESTARTS   AGE
kube-system   coredns-fb8b8dccf-scdx4              0/1     Error              3          4m44s
kube-system   coredns-fb8b8dccf-sfwgd              0/1     CrashLoopBackOff   3          4m44s
kube-system   etcd-raj-laptop                      1/1     Running            0          3m49s
kube-system   kube-apiserver-raj-laptop            1/1     Running            0          3m36s
kube-system   kube-controller-manager-raj-laptop   1/1     Running            0          3m37s
kube-system   kube-proxy-vkdfh                     1/1     Running            0          4m44s
kube-system   kube-scheduler-raj-laptop            1/1     Running            0          3m30s
kube-system   weave-net-ftxrg                      2/2     Running            0          82s

[verizon@raj-laptop ~]$ kubectl logs coredns-fb8b8dccf-sfwgd -n=kube-system
E0613 16:18:10.815705       1 reflector.go:134] github.com/coredns/coredns/plugin/kubernetes/controller.go:315: Failed to list *v1.Service: Get https://10.96.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
E0613 16:18:10.815705       1 reflector.go:134] github.com/coredns/coredns/plugin/kubernetes/controller.go:315: Failed to list *v1.Service: Get https://10.96.0.1:443/api/v1/services?limit=500&resourceVersion=0: dial tcp 10.96.0.1:443: connect: no route to host
log: exiting because of error: log: cannot create log: open /tmp/coredns.coredns-fb8b8dccf-sfwgd.unknownuser.log.ERROR.20190613-161810.1: no such file or directory

Solutions

systemctl disable firewalld
systemctl stop firewalld
systemctl reboot
systemctl stop kubelet
systemctl stop docker

iptables -P FORWARD ACCEPT
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
ip6tables -t nat -F
ip6tables -t mangle -F
ip6tables -F
ip6tables -X
ip6tables -P INPUT ACCEPT
ip6tables -P FORWARD ACCEPT
ip6tables -P OUTPUT ACCEPT


$ systemctl stop kubelet
$ systemctl stop docker
$ iptables --flush
$ iptables -tnat --flush
$ systemctl start kubelet
$ systemctl start docker
Rajesh Kumar
Follow me