<p>I have installed a Kubernetes cluster of 3 nodes with the calico network plugin.
For some reason I decided to remove totally kubernetes and reisntall it with a different network plugin: Flannel.</p>

<p>All seemed fine until I tried to deploy my first container.</p>

<p><code>kubectl describe pod/cassandra</code> return the following error:</p>

<pre><code>Unknown desc = [failed to set up sandbox container "957f68c3cbe9b230b0e2bd6729a12c340f903de568622e28e335f7b48563a445" network for pod "cassandra-d7db46b86-dz7ck": networkPlugin cni failed to set up pod "cassandra-d7db46b86-dz7ck_default" network: error getting ClusterInformation: Get https://[10.96.0.1]:443/apis/crd.projectcalico.org/v1/clusterinformations/default: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes"), failed to clean up sandbox container "957f68c3cbe9b230b0e2bd6729a12c340f903de568622e28e335f7b48563a445" network for pod "cassandra-d7db46b86-dz7ck": networkPlugin cni failed to teardown pod "cassandra-d7db46b86-dz7ck_default" network: error getting ClusterInformation: Get https://[10.96.0.1]:443/apis/crd.projectcalico.org/v1/clusterinformations/default: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")]
  Normal   SandboxChanged          3s (x3 over 18s)  kubelet, &lt;node name&gt;  Pod sandbox changed, it will be killed and re-created.
</code></pre>

<p>By reading at the errors it seems that the calico plugin is still used by Kubernetes, although I removed it and installed the Flannel plugin.</p>

<p>How can I clean this mess ?</p>

jerome
<ol>
<li>Clear ip route: ip route flush proto bird</li>
<li>remove all calico links in all nodes</li>
</ol>
<pre><code>ip link list | grep cali | awk '{print $2}' | cut -c 1-15 | xargs -I {} ip link delete {}
</code></pre>
<ol start="3">
<li>remove ipip module modprobe -r ipip</li>
<li>remove calico configs</li>
</ol>
<pre><code>rm /etc/cni/net.d/10-calico.conflist &amp;&amp; rm /etc/cni/net.d/calico-kubeconfig
</code></pre>
<ol start="5">
<li>restart kubelet service</li>
</ol>
<p>After this you install flannel.</p>
