<p>I am building a Kubernetes cluster following this <a href="https://www.profiq.com/kubernetes-cluster-setup-using-virtual-machines/" rel="nofollow noreferrer">tutorial</a>, and I have troubles to access the Kubernetes dashboard. I already created another question about it that you can see <a href="https://stackoverflow.com/questions/55596900/kubernetes-access-dashboard-from-remote-browser">here</a>, but while digging up into my cluster, I think that the problem might be somewhere else and that's why I create a new question.</p>

<p>I start my master, by running the following commands: </p>

<pre><code>&gt; kubeadm reset 
&gt; kubeadm init --apiserver-advertise-address=[MASTER_IP] &gt; file.txt
&gt; tail -2 file.txt &gt; join.sh # I keep this file for later

&gt; kubectl apply -f https://git.io/weave-kube/

&gt; kubectl -n kube-system get pod
NAME                                READY   STATUS  RESTARTS    AGE
coredns-fb8b8dccf-kb2zq             0/1     Pending 0           2m46s
coredns-fb8b8dccf-nnc5n             0/1     Pending 0           2m46s
etcd-kubemaster                     1/1     Running 0           93s
kube-apiserver-kubemaster           1/1     Running 0           93s
kube-controller-manager-kubemaster  1/1     Running 0           113s
kube-proxy-lxhvs                    1/1     Running 0           2m46s
kube-scheduler-kubemaster           1/1     Running 0           93s
</code></pre>

<p>Here we can see that I have two <code>coredns</code> pods stuck in Pending state forever, and when I run the command : </p>

<pre><code>&gt; kubectl -n kube-system describe pod coredns-fb8b8dccf-kb2zq
</code></pre>

<p>I can see in the Events part the following Warning : </p>

<pre><code>Failed Scheduling : 0/1 nodes are available 1 node(s) had taints that the pod didn't tolerate.
</code></pre>

<p>Since it is a Warning and not and Error, and that as a Kubernetes newbie, <code>taints</code> does not mean much to me, I tried to connect a node to the master (using the previously saved command) : </p>

<pre><code>&gt; cat join.sh
kubeadm join [MASTER_IP]:6443 --token [TOKEN] \
    --discovery-token-ca-cert-hash sha256:[ANOTHER_TOKEN]

&gt; ssh [USER]@[WORKER_IP] 'bash' &lt; join.sh

This node has joined the cluster.
</code></pre>

<p>On the master, I check that the node is connected: </p>

<pre><code>&gt; kubectl get nodes 
NAME        STATUS      ROLES   AGE     VERSION
kubemaster  NotReady    master  13m     v1.14.1
kubeslave1  NotReady    &lt;none&gt;  31s     v1.14.1
</code></pre>

<p>And I check my pods : </p>

<pre><code>&gt; kubectl -n kube-system get pod
NAME                                READY   STATUS              RESTARTS    AGE
coredns-fb8b8dccf-kb2zq             0/1     Pending             0           14m
coredns-fb8b8dccf-nnc5n             0/1     Pending             0           14m
etcd-kubemaster                     1/1     Running             0           13m
kube-apiserver-kubemaster           1/1     Running             0           13m
kube-controller-manager-kubemaster  1/1     Running             0           13m
kube-proxy-lxhvs                    1/1     Running             0           14m
kube-proxy-xllx4                    0/1     ContainerCreating   0           2m16s
kube-scheduler-kubemaster           1/1     Running             0           13m
</code></pre>

<p>We can see that another kube-proxy pod have been created and is stuck in ContainerCreating status.</p>

<p>And when I am doing a describe again : </p>

<pre><code>kubectl -n kube-system describe pod kube-proxy-xllx4
</code></pre>

<p>I can see in the Events part multiple identical Warnings : </p>

<pre><code>Failed create pod sandbox : rpx error: code = Unknown desc = failed pulling image "k8s.gcr.io/pause:3.1": Get https://k8s.gcr.io/v1/_ping: dial tcp: lookup k8s.gcr.io on [::1]:53 read up [::1]43133-&gt;[::1]:53: read: connection refused
</code></pre>

<p>Here are my repositories :  </p>

<pre><code>docker image ls
REPOSITORY                          TAG     
k8s.gcr.io/kube-proxy               v1.14.1 
k8s.gcr.io/kube-apiserver           v1.14.1 
k8s.gcr.io/kube-controller-manager  v1.14.1 
k8s.gcr.io/kube-scheduler           v1.14.1 
k8s.gcr.io/coredns                  1.3.1   
k8s.gcr.io/etcd                     3.3.10  
k8s.gcr.io/pause                    3.1 
</code></pre>

<p>And so, for the dashboard part, I tried to start it with the command </p>

<pre><code>&gt; kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/recommended/kubernetes-dashboard.yaml
</code></pre>

<p>But the dashboard pod is stuck in Pending state.</p>

<pre><code>kubectl -n kube-system get pod
NAME                                    READY   STATUS              RESTARTS    AGE
coredns-fb8b8dccf-kb2zq                 0/1     Pending             0           40m
coredns-fb8b8dccf-nnc5n                 0/1     Pending             0           40m
etcd-kubemaster                         1/1     Running             0           38m
kube-apiserver-kubemaster               1/1     Running             0           38m
kube-controller-manager-kubemaster      1/1     Running             0           39m
kube-proxy-lxhvs                        1/1     Running             0           40m
kube-proxy-xllx4                        0/1     ContainerCreating   0           27m
kube-scheduler-kubemaster               1/1     Running             0           38m
kubernetes-dashboard-5f7b999d65-qn8qn   1/1     Pending             0           8s
</code></pre>

<p>So, event though my problem originaly was that I cannot access to my dashboard, I guess that the real problem is deeper thant that.</p>

<p>I know that I just put a lot of information here, but I am a k8s beginner and I am completely lost on this.</p>

<p>There is an issue I experienced with <code>coredns</code> pods stuck in a pending mode when setting up your own cluster; which I resolve by adding pod network.</p>

<p>Looks like because there is no Network Addon installed, the nodes are taint as <code>not-ready</code>. Installing the Addon would remove the taints and the Pods will be able to schedule. In my case adding <em>flannel</em> fixed the issue.</p>

<p>EDIT: There is a note about this in the official <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network" rel="nofollow noreferrer">k8s documentation - Create cluster with kubeadm</a>:</p>

<blockquote>
  <p>The network must be deployed before any applications.  <strong><em>Also, CoreDNS
  will not start up before a network is installed.</em></strong>  kubeadm only
  supports Container Network Interface (CNI) based networks (and does
  not support kubenet).</p>
</blockquote>
