<p>I am new with Kubernetes and am trying to setup a Kubernetes cluster on local machines. Bare metal. No OpenStack, No Maas or something.</p>

<p>After <code>kubeadm init ...</code> on the master node, <code>kubeadm join ...</code> on the slave nodes and <a href="https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml" rel="nofollow noreferrer">applying flannel</a> at the master I get the message from the slaves:</p>

<blockquote>
  <p>runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized</p>
</blockquote>

<p>Can anyone tell me what I have done wrong or missed any steps?
Should flannel be applied to all the slave nodes as well? If yes, they do not have a <code>admin.conf</code>...</p>

<p>Thanks a lot!</p>

<p>PS. All the nodes do not have internet access. That means all files have to be copied manually via ssh.</p>

<p>I think this problem cause by kuberadm first init coredns but not init flannel,so it throw "network plugin is not ready: cni config uninitialized".<br>
Solution:<br>
1. Install flannel by <code>kubectl -n kube-system apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml</code><br>
2. Reset the coredns pod<br>
<code>kubectl delete coredns-xx-xx</code><br>
3. Then run <code>kubectl get pods</code> to see if it works.</p>

<p>if you see this error "cni0" already has an IP address different from 10.244.1.1/24".
follow this:</p>

<pre><code>ifconfig  cni0 down
brctl delbr cni0
ip link delete flannel.1
</code></pre>

<p>if you see this error "Back-off restarting failed container", and you can get the log by</p>

<pre><code>root@master:/home/moonx/yaml# kubectl logs coredns-86c58d9df4-x6m9w -n=kube-system
.:53
2019-01-22T08:19:38.255Z [INFO] CoreDNS-1.2.6
2019-01-22T08:19:38.255Z [INFO] linux/amd64, go1.11.2, 756749c
CoreDNS-1.2.6
linux/amd64, go1.11.2, 756749c
 [INFO] plugin/reload: Running configuration MD5 = f65c4821c8a9b7b5eb30fa4fbc167769
 [FATAL] plugin/loop: Forwarding loop detected in "." zone. Exiting. See https://coredns.io/plugins/loop#troubleshooting. Probe query: "HINFO 1599094102175870692.6819166615156126341.".
</code></pre>

<p>Then you can see the file "/etc/resolv.conf" on the failed node, if the nameserver is localhost there will be a loopback.Change to:</p>

<pre><code>#nameserver 127.0.1.1
nameserver 8.8.8.8
</code></pre>
