<p>I am trying to setup the kubernetes cluster on the AWS.
I install the docker, kubelet, kubectl and kubeadm.</p>

<p>I have create 3 EC2 instances and assigned a Elastic IP to one VM.</p>

<p>On the Master node (having the Elastic IP), I run the following command:</p>

<pre><code>sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=3.18.117.205
</code></pre>

<p>During the init process it stuck at the initialisation and returns the timeout error. Following are the logs of the Kubelet:</p>

<pre><code>Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.511349   17171 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/config/apiserver
Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.513005   17171 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/kubelet.go:453: 
Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.516066   17171 reflector.go:125] k8s.io/client-go/informers/factory.go:133: Fai
Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.537776   17171 reflector.go:125] k8s.io/kubernetes/pkg/kubelet/kubelet.go:444: 
Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.601084   17171 kubelet.go:2248] node "ip-172-31-16-195" not found
Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.701293   17171 kubelet.go:2248] node "ip-172-31-16-195" not found
Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.801496   17171 kubelet.go:2248] node "ip-172-31-16-195" not found
Jul 19 05:11:29 ip-172-31-16-195 kubelet[17171]: E0719 05:11:29.901732   17171 kubelet.go:2248] node "ip-172-31-16-195" not found
Jul 19 05:11:30 ip-172-31-16-195 kubelet[17171]: E0719 05:11:30.001992   17171 kubelet.go:2248] node "ip-172-31-16-195" not found
Jul 19 05:11:30 ip-172-31-16-195 kubelet[17171]: E0719 05:11:30.102215   17171 kubelet.go:2248] node "ip-172-31-16-195" not found
</code></pre>

<p>If i use the following command:</p>

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

<p>Then the initialisation is successfully done and I get the command to join the network.</p>

<p>The join command contains the Private IP address of the VM.</p>

<p>So if I use the above join command and creates the cluster with it then if in any case, I reboot the master node, then will it effect the cluster like change in the Private IP of the machine?</p>

<p>If not, then what is the use of Elastic IP?</p>

<p>Any help, will be really appreciated.</p>

<p>Thanks</p>

Sahil
<blockquote>
  <p>I reboot the master node, then will it effect the cluster like change
  in the Private IP of the machine?</p>
</blockquote>

<p>Rebooting an EC2 instance does <strong>not</strong> change the private IP address of the instance; it only changes the public address (unless it's an Elastic IP).</p>

<p>So you don't have to worry. And you don't need the Elastic IP to advertise the apiserver to the rest of the nodes in the cluster. In fact, you want the instances communicating over private IP as a matter of best practices.</p>

<blockquote>
  <p>If not, then what is the use of Elastic IP?</p>
</blockquote>

<p>There is no use. Did a setup guide tell you that you need an Elastic IP?</p>

<p>I couldn't tell you more about <em>why</em> the Elastic IP is causing issues without knowing more about your network setup.</p>

<p>You could try to re-run <code>kubeadm init</code> with logging verbosity turned up <code>-v=2</code> and post the output here if you want further help on troubleshooting.</p>

<p><a href="https://github.com/kubernetes/kubeadm/issues/1390#issuecomment-484079629" rel="nofollow noreferrer">Or you could try using the <code>--apiserver-cert-extra-sans=&lt;public ip address&gt;</code> instead of <code>--apiserver-advertise-address</code></a> </p>
