<p>I am trying to install Kubernetes in my on-premise server Ubuntu 16.04. And referring following documentation ,</p>

<p><a href="https://medium.com/@Grigorkh/install-kubernetes-on-ubuntu-1ac2ef522a36" rel="nofollow noreferrer">https://medium.com/@Grigorkh/install-kubernetes-on-ubuntu-1ac2ef522a36</a></p>

<p>After installing kubelete kubeadm and kubernetes-cni I found that to initiate kubeadm with following command,</p>

<pre><code>kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=10.133.15.28 --kubernetes-version stable-1.8
</code></pre>

<p>Here I am totally confused about why we are setting cidr and api server advertise address. I am adding few confusion from Kubernetes here,</p>

<ol>
<li>Why we are specifying CIDR and --apiserver-advertise-address here?</li>
<li>How I can find these two address for my server?</li>
<li>And why flannel is using in Kubernetes installation?</li>
</ol>

<p>I am new to this containerization and Kubernetes world.</p>

Mr.DevEng
<blockquote>
<p>Why we are specifying CIDR and --apiserver-advertise-address here?</p>
<p>And why flannel is using in kubernetes installation?</p>
</blockquote>
<p>Kubernetes using <a href="https://github.com/containernetworking/cni" rel="nofollow noreferrer">Container Network Interface</a> for creating a special virtual network inside your cluster for communication between pods.</p>
<p>Here is some explanation &quot;why&quot; from <a href="https://kubernetes.io/docs/concepts/cluster-administration/networking/" rel="nofollow noreferrer">documentation</a>:</p>
<blockquote>
<p>Kubernetes imposes the following fundamental requirements on any networking implementation (barring any intentional network segmentation policies):</p>
<ul>
<li>all containers can communicate with all other containers without NAT</li>
<li>all nodes can communicate with all containers (and vice-versa) without NAT</li>
<li>the IP that a container sees itself as is the same IP that others see it as</li>
</ul>
<p>Kubernetes applies IP addresses at the Pod scope - containers within a Pod share their network namespaces - including their IP address. This means that containers within a Pod can all reach each other’s ports on localhost. This does imply that containers within a Pod must coordinate port usage, but this is no different than processes in a VM. This is called the “IP-per-pod” model.</p>
</blockquote>
<p>So, Flannel is one of the CNI which can be used for create network which will connect all your pods and CIDR option define a subnet for that network. There are many alternative CNI with similar functions.</p>
<p>If you want to get more details about how network working in Kubernetes you can read by link above or, as example, <a href="https://medium.com/google-cloud/understanding-kubernetes-networking-pods-7117dd28727." rel="nofollow noreferrer">here</a>.</p>
<blockquote>
<p>How I can find these two address for my server?</p>
</blockquote>
<p>API server advertise address has to be only one and static. That address using by all components to communicate with API server. Unfortunately, Kubernetes has no support of multiple API server addresses per master.</p>
<p>But, you can still use as many addresses on your server as you want, but only one of them you can define as <code>--apiserver-advertise-address</code>. The only one request for it - it has to be accessible from all your nodes in cluster.</p>
