<p>When I reboot the master and work node, the pod of coredns show the below error message seem that it can not recreate kubelet after server restart.</p>

<pre><code>  Normal   SandboxChanged          12s                   kubelet, izbp1dyjigsfwmw0dtl85gz  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  11s                   kubelet, izbp1dyjigsfwmw0dtl85gz  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "5e850ee3e8bf86688fec2badd9b0272127a0d775620a5783e7c30b4e0d412b01" network for pod "coredns-6955765f44-4xnhj": networkPlugin cni failed to set up pod "coredns-6955765f44-4xnhj_kube-system" network: open /run/flannel/subnet.env: no such file or directory
</code></pre>

ccd
<p>You can try cleaning up flannel and reinstalling it.</p>

<pre><code>kubectl delete -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml

rm -rf /var/lib/cni/
rm -rf /run/flannel
rm -rf /etc/cni/
</code></pre>

<p>Remove interfaces related to and flannel:</p>

<pre><code>ip link 
</code></pre>

<p>For each interface flannel, do the following</p>

<pre><code>ifconfig &lt;name of interface from ip link&gt; down
ip link delete &lt;name of interface from ip link&gt;
</code></pre>

<p>After this install flannel </p>

<pre><code>kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/2140ac876ef134e0ed5af15c65e414cf26827915/Documentation/kube-flannel.yml
</code></pre>

<p>For flannel to work correctly, you must pass --pod-network-cidr=10.244.0.0/16 to kubeadm init</p>
