<p>i installed a <code>kubeadm</code> v1.17 cluster with weave initially. I would like to switch it over to use calico. However, as i originally did not install the cluster with </p>

<pre><code>kubeadm init --pod-network-cidr=192.168.0.0/16
</code></pre>

<p>as per the docs, but with a simple</p>

<pre><code>kubeadm init
</code></pre>

<p>i was wondering what steps i need to perform to achieve the transition from weave to calico? </p>

<p>To change CNI from Weave Net to Calico in the cluster you can do the following:</p>

<p>Delete weave-net pods configuration:</p>

<pre><code>kubectl delete -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
</code></pre>

<p>Then change podCIDR by running following command on your master node:</p>

<pre><code>sudo kubeadm init phase control-plane controller-manager --pod-network-cidr=192.168.0.0/16
</code></pre>

<p><code>192.168.0.0/16</code> is the default podCIDR used by Calico and can be changed <strong>only once.</strong> </p>

<p>If you try to change it afterwards it will show error:</p>

<blockquote>
  <p>spec.podCIDRs: Forbidden: node updates may not change podCIDR except
  from "" to valid</p>
</blockquote>

<p>so it's one way operation. </p>

<p>After that you can apply calico:</p>

<pre><code>kubectl apply -f https://docs.projectcalico.org/v3.11/manifests/calico.yaml
</code></pre>

<p>Additionally if you choose to set different podCIDR you have to specify podCIDR in <code>kubeadm init</code>:</p>

<pre><code>sudo kubeadm init phase control-plane all --pod-network-cidr=&lt;your_podCIDR&gt;
</code></pre>

<p>then modify Calico DaemonSet:</p>

<pre><code>...
- name: CALICO_IPV4POOL_CIDR
value: "&lt;your_podCIDR&gt;"
...
</code></pre>

<p>and then apply it. But as mentioned before, you cannot do it once the podCIDR was specified. It can be added but cannot be modified later.</p>
