<p>I created 3 vbox VM for testing k8s. Each vm has 2 netwoks: Nat and internal.
K8s was initialized with:</p>

<pre><code>kubeadm init --apiserver-advertise-address 192.168.1.1 --service-cidr 192.168.1.0/24 --pod-network-cidr 192.168.1.0/24
</code></pre>

<p>192.168.1.0/24 is the internal network.
Nodes were joined by</p>

<pre><code>kubeadm join 192.168.1.1:6443 --token some_token --discovery-token-ca-cert-hash hash
</code></pre>

<p>When I'm trying to deploy flannel I get errors like:</p>

<pre><code>I0629 09:25:06.640787       1 main.go:475] Determining IP address of default interface
I0629 09:25:06.645316       1 main.go:488] Using interface with name enp0s3 and address 10.0.2.15
I0629 09:25:06.645335       1 main.go:505] Defaulting external address to interface address (10.0.2.15)
I0629 09:25:06.656691       1 kube.go:131] Waiting 10m0s for node controller to sync
I0629 09:25:06.656794       1 kube.go:294] Starting kube subnet manager
I0629 09:25:07.657778       1 kube.go:138] Node controller sync successful
I0629 09:25:07.657795       1 main.go:235] Created subnet manager: Kubernetes Subnet Manager - kub2
I0629 09:25:07.657798       1 main.go:238] Installing signal handlers
I0629 09:25:07.657892       1 main.go:353] Found network config - Backend type: vxlan
I0629 09:25:07.657928       1 vxlan.go:120] VXLAN config: VNI=1 Port=0 GBP=false DirectRouting=false
E0629 09:25:07.658039       1 main.go:280] Error registering network: failed to acquire lease: node "kub2" pod cidr not assigned
</code></pre>

<p>what am I doing wrong?</p>

<p>As per error string in your logs:</p>
<blockquote>
<p>E0629 09:25:07.658039       1 main.go:280] Error registering network:
failed to acquire lease: node &quot;kub2&quot; pod cidr not assigned</p>
</blockquote>
<p>It seems you used subnet <code>192.168.1.0/24</code> which was fully distributed for master node creation; however, there were not enough IP pools for work nodes building, as by default <code>kube-controller-manager</code> gives /24 network for each node. As the solution, you can use wider network subnet addressing, and also be aware that subnets you intend to use can't be a part of each other.</p>
<p>For  example, if you have your local network <code>192.168.1.0/24</code>, then</p>
<ul>
<li><code>--service-cidr</code> should be like <code>192.168.2.0/24</code> and</li>
<li><code>--pod-network-cidr</code> like <code>172.17.0.0/16</code></li>
</ul>
