Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started 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
DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.