<p>I´m setting up kubernetes on GKE as described in Kelsey Hightowers <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/" rel="nofollow noreferrer">https://github.com/kelseyhightower/kubernetes-the-hard-way/</a></p>

<p>Everything works fine except for setting up the DNS ClusterAddon <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/12-dns-addon.md" rel="nofollow noreferrer">https://github.com/kelseyhightower/kubernetes-the-hard-way/blob/master/docs/12-dns-addon.md</a></p>

<p>When I start kube-dns like that:</p>

<blockquote>
  <p>kubectl create -f
  <a href="https://storage.googleapis.com/kubernetes-the-hard-way/kube-dns.yaml" rel="nofollow noreferrer">https://storage.googleapis.com/kubernetes-the-hard-way/kube-dns.yaml</a></p>
</blockquote>

<p>I do get the expected output :</p>

<pre><code> serviceaccount "kube-dns" created 
 configmap "kube-dns" created 
 service "kube-dns" 
 created deployment "kube-dns" created
</code></pre>

<p>But checking state of the pods and the output of the kube-dns container I see errors:</p>

<pre><code>kubectl get po -n kube-system
NAME                        READY     STATUS             RESTARTS   AGE
kube-dns-6c857864fb-cpvvr   2/3       CrashLoopBackOff   63         2h
</code></pre>

<p>and in the container log:</p>

<pre><code>I0115 13:22:35.272492       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:35.772476       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:36.272406       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:36.772356       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0115 13:22:37.272386       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
E0115 13:22:37.273178       1 reflector.go:201] k8s.io/dns/pkg/dns/dns.go:147: Failed to list *v1.Endpoints: Get https://10.32.0.1:443/api/v1/endpoints?resourceVersion=0: dial tcp 10.32.0.1:443: i/o timeout
E0115 13:22:37.273340       1 reflector.go:201] k8s.io/dns/pkg/dns/dns.go:150: Failed to list *v1.Service: Get https://10.32.0.1:443/api/v1/services?resourceVersion=0: dial tcp 10.32.0.1:443: i/o timeout
</code></pre>

<p>The URL <a href="https://10.32.0.1:443" rel="nofollow noreferrer">https://10.32.0.1:443</a> in the container log seems to be wrong, but I cannot find any place where I can specify a different URL and neither the place where this URL is set in the config file <a href="https://storage.googleapis.com/kubernetes-the-hard-way/kube-dns.yaml" rel="nofollow noreferrer">https://storage.googleapis.com/kubernetes-the-hard-way/kube-dns.yaml</a></p>

<p>The URL comes from internal kubernetes information (service account token) and it should be fine (it should point to the first IP in the range assigned to service network, and that should be the <code>kubernetes.default</code> service. What you need to check is if your pod-to-pod networking and kube-proxy (it implements service ClusterIPs) works as expected.</p>

<p>If you do <code>kubectl get svc kubernetes -o yaml</code> you should see a kubernetes service with that <code>10.32.0.1</code> IP so confirm that as well (apiserver registers its own IP for this svc so doing <code>ksp get endpoints kubernetes</code> should give you API IP/PORT)</p>
