mona moghadampanah
mona moghadampanah

Reputation: 343

coredns running status but not become ready

I have a k8s cluster with three masters, two workers, and an external haproxy and use flannel as a cni. The coredns have problems, and their status is running, but they don't become ready.

Coredns log

1

I get the logs of this pod, and I get this message:

[INFO] plugin/ready: Still waiting on: "Kubernetes."

What I do to solve this problem but didn't get any result:
1- check ufw and disable it.
2- check IPtables and flush them.
3- check Kube-proxy logs.
4- check the haproxy, and it is accessible from out and all servers in the cluster.
5- check nodes network.
7- reboot all servers at the end. :))

I get describe po :

describe pod

Upvotes: 2

Views: 4606

Answers (2)

Ali
Ali

Reputation: 1461

Lets see your CoreDNS works at all?

  • You can crete a simple pod and go inside and from there, curl Services via IP:PORT & Service-name:PORT
    kubectl run -it --rm test-nginx-svc --image=nginx  -- bash
    
  1. IP:PORT
    curl http://<SERVICE-IP>:8080
    
  2. DNS
    curl http://nginx-service:8080
    

If you couldn't curl your service via Service-name:PORT then you probably have a DNS Issue....


CoreDNS

Service Name Resolution Problems?

  • Check CoreDNS Pods are running and accessible?
  • Check CoreDNS logs
kubectl run -it test-nginx-svc --image=nginx -- bash
  • Inside the Pod
    cat /etc/resolv.conf 
    
  • The result would look like:
    nameserver 10.96.0.10 # IP address of CoreDNS
    search default.svc.cluster.local svc.cluster.local cluster.local
    options ndots:5
    

If It is NOT working:

I suggest to try re-install it via official docs or helm chart

OR

Try onther CNIs like weave


Source

Upvotes: 1

mona moghadampanah
mona moghadampanah

Reputation: 343

I solve the problem. It didn't relate to coredns. It was about the IPtables rule. Some rules for Kubernetes svc did not create. Now with the rules which are in the picture, everything is okay:

iptables rules

Upvotes: 0

Related Questions