<p>I have a multi-master Kubernetes cluster set up, with one worker node. I set up the cluster with kubeadm. On <code>kubeadm init</code>, I passed the <code>-pod-network-cidr=10.244.0.0/16</code> (using Flannel as the network overlay).</p>

<p>When using <code>kubeadm join</code> on the first worker node, everything worked properly. For some reason when trying to add more workers, none of the nodes are automatically assigned a podCidr.</p>

<p>I used <a href="https://github.com/coreos/flannel/blob/master/Documentation/troubleshooting.md" rel="nofollow noreferrer">this</a> document to manually patch each worker node, using the 
<code>kubectl patch node &lt;NODE_NAME&gt; -p '{"spec":{"podCIDR":"&lt;SUBNET&gt;"}}'</code> command and things work fine.</p>

<p>But this is not ideal, I am wondering how I can fix my setup so that just adding the <code>kubeadm join</code> command will automatically assign the podCidr.</p>

<p>Any help would be greatly appreciated. Thanks!</p>

<p><strong>Edit:</strong></p>

<pre><code>I1003 23:08:55.920623       1 main.go:475] Determining IP address of default interface

I1003 23:08:55.920896       1 main.go:488] Using interface with name eth0 and address 

I1003 23:08:55.920915       1 main.go:505] Defaulting external address to interface address ()

I1003 23:08:55.941287       1 kube.go:131] Waiting 10m0s for node controller to sync

I1003 23:08:55.942785       1 kube.go:294] Starting kube subnet manager

I1003 23:08:56.943187       1 kube.go:138] Node controller sync successful

I1003 23:08:56.943212       1 main.go:235] Created subnet manager: 
</code></pre>

<p>Kubernetes Subnet Manager - kubernetes-worker-06</p>

<pre><code>I1003 23:08:56.943219       1 main.go:238] Installing signal handlers

I1003 23:08:56.943273       1 main.go:353] Found network config - Backend type: vxlan

I1003 23:08:56.943319       1 vxlan.go:120] VXLAN config: VNI=1 Port=0 GBP=false DirectRouting=false

E1003 23:08:56.943497       1 main.go:280] Error registering network: failed to acquire lease: node "kube-worker-02" pod cidr not assigned

I1003 23:08:56.943513       1 main.go:333] Stopping shutdownHandler...
</code></pre>

<p>I was able to solve my issue. In my multi-master setup, on <em>one</em> of my master nodes, the <code>kube-controller-manager.yaml</code> (in /etc/kubernetes/manifest) file was missing the two following fields:</p>

<ul>
<li><code>--allocate-node-cidrs=true</code></li>
<li><code>--cluster-cidr=10.244.0.0/16</code></li>
</ul>

<p>Once adding these fields to the yaml, I reset the <code>kubelet</code> service and everything was working great when trying to add a new worker node.</p>

<p>This was a mistake on my part, because when initializing one of my master nodes with <code>kubeadm init</code>, I must of forgot to pass the <code>--pod-network-cidr</code>. Oops.</p>

<p>Hope this helps someone out there!</p>
