<p>I have six desktop machines in my network and I want to build two Kubernetes clusters. Each machine has Ubuntu 16.04 LTS installed. Initially, all the machines were part of a single cluster. However, I removed three of the machines to setup another cluster, and executed the following command on each of these machine:</p>

<pre><code>RESET COMMAND:
sudo kubeadm reset -f &amp;&amp; 
 sudo systemctl stop kubelet &amp;&amp; 
 sudo systemctl stop docker &amp;&amp; 
 sudo rm -rf /var/lib/cni/ &amp;&amp; 
 sudo rm -rf /var/lib/kubelet/* &amp;&amp; 
 sudo rm -rf /etc/cni/ &amp;&amp; 
 sudo ifconfig cni0 down &amp;&amp; 
 sudo ifconfig flannel.1 down &amp;&amp; 
 sudo ifconfig docker0 down &amp;&amp; 
 sudo ip link delete cni0 &amp;&amp; 
 sudo ip link delete flannel.1
</code></pre>

<p>After this I rebooted each machine, and proceeded with the setup of a new cluster, by setting up the master node:</p>

<pre><code>INSTALL COMMAND:
sudo kubeadm init phase certs all &amp;&amp; 
 sudo kubeadm init phase kubeconfig all &amp;&amp; 
 sudo kubeadm init phase control-plane all --pod-network-cidr 10.244.0.0/16 &amp;&amp;
 sudo sed -i 's/initialDelaySeconds: [0-9][0-9]/initialDelaySeconds: 240/g' /etc/kubernetes/manifests/kube-apiserver.yaml &amp;&amp;
 sudo sed -i 's/failureThreshold: [0-9]/failureThreshold: 18/g' /etc/kubernetes/manifests/kube-apiserver.yaml &amp;&amp;
 sudo sed -i 's/timeoutSeconds: [0-9][0-9]/timeoutSeconds: 20/g' /etc/kubernetes/manifests/kube-apiserver.yaml &amp;&amp;
 sudo kubeadm init \
   --v=1 \
   --skip-phases=certs,kubeconfig,control-plane \
   --ignore-preflight-errors=all \
   --pod-network-cidr 10.244.0.0/16  
</code></pre>

<p>After this I also installed flannel. After the master was successfully installed, I proceeded with the kubeadm join to add the other two machines. After these machines were added, I installed the NGINX-Ingress on the master node.</p>

<p>Now, I wanted to reset the cluster and to re-do this setup again. I reset each machine using the RESET COMMAND and proceeded with the INSTALL command on the master node. However, after I ran the INSTALL command and ran <code>kubectl get pods --all-namespaces</code> I can still see the pods from the previous installation:</p>

<pre><code>NAMESPACE       NAME                              READY   STATUS              RESTARTS   AGE
kube-system     coredns-fb8b8dccf-h5hhk           0/1     ContainerCreating   1          20h
kube-system     coredns-fb8b8dccf-jblmv           0/1     ContainerCreating   1          20h
kube-system     etcd-ubuntu6                      1/1     Running             0          19h
kube-system     kube-apiserver-ubuntu6            1/1     Running             0          76m
kube-system     kube-controller-manager-ubuntu6   0/1     CrashLoopBackOff    7          75m
kube-system     kube-flannel-ds-amd64-4pqq6       1/1     Running             0          20h
kube-system     kube-flannel-ds-amd64-dvfmp       0/1     CrashLoopBackOff    7          20h
kube-system     kube-flannel-ds-amd64-dz9st       1/1     Terminating         0          20h
kube-system     kube-proxy-9vfjx                  1/1     Running             0          20h
kube-system     kube-proxy-q5c86                  1/1     Running             0          20h
kube-system     kube-proxy-zlw4v                  1/1     Running             0          20h
kube-system     kube-scheduler-ubuntu6            1/1     Running             0          76m
nginx-ingress   nginx-ingress-6957586bf6-fg2tt    0/1     Terminating         22         19h
</code></pre>

<p>Why am I seeing the pods from the previous installation?</p>

<p>So yes, basically when you create a single control-plane cluster using <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/" rel="nofollow noreferrer">kubeadm</a> - you are installing cluster that has single control-plane node, with a single etcd database running on it.</p>

<p>The default etcd directory used by kubeadm is <code>/var/lib/etcd</code> on the control-plane node. You should clean it up to avoid restoring previous cluster configuration.</p>

<p>BTW, there is the same <a href="https://stackoverflow.com/questions/56818952/how-to-correctly-recreate-a-kubeadm-1-15-0-cluster">issue</a> for k8s 1.15. And it should be fixed 1.15.1 <a href="https://github.com/kubernetes/sig-release/blob/3a3c9f92ef484656f0cb4867f32491777d629952/releases/patch-releases.md#115" rel="nofollow noreferrer">https://github.com/kubernetes/sig-release/blob/3a3c9f92ef484656f0cb4867f32491777d629952/releases/patch-releases.md#115</a></p>
