kelseyhightower / kubernetes-the-hard-way

Bootstrap Kubernetes the hard way. No scripts.
Apache License 2.0
41.3k stars 14.13k forks source link

Section 12 DNS Addon CoreDNS Pods failing #698

Open GhostPratt opened 2 years ago

GhostPratt commented 2 years ago

Running kubectl apply -f https://storage.googleapis.com/kubernetes-the-hard-way/coredns-1.8.yaml pulls and applies the configuration successfully.

The coredns pods though are failing to come up at all. Falling into a CrashLoopBackOff error and restarting for time eternal. Pulling back the logs I'm getting: plugin/kubernetes: Get "https://10.32.0.1:443/version?timeout=32s": dial tcp 10.32.0.1:443: i/o timeout plugin/kubernetes: Get "https://10.32.0.1:443/version?timeout=32s": dial tcp 10.32.0.1:443: i/o timeout

Othertimes have been no logs whatsoever. Any assistance would be greatly appreciated.

danilo-lopes commented 2 years ago

I'm having the same problem here.

kube-system/coredns-8494f9c688-rjvmg:coredns

plugin/kubernetes: Get "https://10.32.0.1:443/version?timeout=32s": dial tcp 10.32.0.1:443: i/o timeout

I didnt understand about Kube API server CIDR routing logic (10.32.0.0/24 in this case).

In my case, I have on-primeses environment. I dont have networking firewall rules and all hosts can talk to each other. All worker nodes have local linux routing for the POD network (10.200.0.0/24).

mguttsait commented 1 year ago

@GhostPratt @danilo-lopes Did you ever wind up figuring this out?

danilo-lopes commented 1 year ago

@mguttsait I dont have this cluster anymore, I have to setup it again..

carlchen8617 commented 1 year ago

I have two PCs(not VMs), one as controller node, one as worker node, both get IP address from the DHCP server on the home ADSL router. Tried kube-dns and coredns. In both cases the dns pods are trying to dial the service clusterIP(10.32.0.1:443) of the api server and getting i/o timeout issue and never succeeded. Still digging for solutions

mirik12 commented 1 year ago

apiVersion: v1 kind: ServiceAccount metadata: name: coredns namespace: kube-system

apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: labels: kubernetes.io/bootstrapping: rbac-defaults name: system:coredns rules:

mirik12 commented 1 year ago

https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/deployments/coredns-1.7.0.yaml

but change the versions into the file (one place)