<p>Had to change node (server) with the new one leaving the <strong>same node name</strong>. What I did was:</p>

<ul>
<li>master> kubectl delete no srv1 (removing old node)</li>
<li>srv1> kubeadm join... (joining new node)</li>
</ul>

<p>after new node joined cluster no pods can be created.</p>

<pre><code>Warning  FailedCreatePodSandBox  16s               kubelet, srv1  Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "b85728b51a18533e9d57f6a1b1808dbb5ad72bff4d516217de04e7dad4ce358d" network for pod "dpl-6f56777485-6jzm6": NetworkPlugin cni failed to set up pod "dpl-6f56777485-6jzm6_default" network: failed to set bridge addr: "cni0" already has an IP address different from 10.244.16.1/24
</code></pre>

Jonas
<p>Ideally when performing such a task like "replacing a node" below steps should be considered:</p>

<ol>
<li>Drain node <code>kubectl drain NODE_NAME</code></li>
<li>Reset that node <code>kubeadm reset</code> in the old node (optional step if the old node is accessible)</li>
<li>Finally <code>kubeadm delete node NODE_NAME</code></li>
</ol>

<p>Things to consider when replacing a old node with new node:</p>

<ol>
<li>The new node should have the same name as the old node which is <code>echo $HOSTNAME</code> should remain same.</li>
<li>The new node should have the same ip as the old one.</li>
</ol>

<p>Because these are a node identity.</p>

<p>Finally in a scenario where you have already performed <code>kubectl delete node ...</code> and replaced it with a new one.</p>

<pre class="lang-sh prettyprint-override"><code>curl -LO https://raw.githubusercontent.com/coreos/flannel/62e44c867a2846fefb68bd5f178daf4da3095ccb/Documentation/kube-flannel.yml
kubectl delete -f kube-flannel.yml
</code></pre>

<p>[perform below in the nodes which are having problems]</p>

<pre><code>sudo ip link del cni0
sudo ip link del flannel.1
sudo systemctl restart network
</code></pre>

<p>[re-apply network plugin]</p>

<pre><code>kubectl apply -f kube-flannel.yml
</code></pre>
