<p>I have 3 VPS based on Ubuntu 18.04 server and would like to build a kubernetes cluster.</p>

<p>I going to use Kubespray to install the Kubernetes cluster and my questions are: </p>

<ul>
<li>How to prepare servers, that they can talk to each other</li>
<li>How to setup the firewall, that the communication between VPS do not block</li>
<li>Is it possible to configure the firewall, to open particular port for a particular IP address. For example, only a VPS with 1.11.111.110 is allowed to access the port 10255 on VPS 1.11.111.111.</li>
<li>What else do I have to consider? </li>
</ul>

<blockquote>
  <ul>
  <li>How to prepare servers, that they can talk to each other</li>
  </ul>
</blockquote>

<p>For prepare your Ubuntu instances to install Kubernetes you could check <a href="https://hostadvice.com/how-to/how-to-set-up-kubernetes-in-ubuntu/" rel="nofollow noreferrer">this</a> guide. 
Use the kubespray <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubespray/" rel="nofollow noreferrer">documentation</a> to create your cluster.</p>

<blockquote>
  <ul>
  <li>How to setup the firewall, that the communication between VPS do not block</li>
  <li>Is it possible to configure the firewall, to open particular port for a particular IP address. For example, only a VPS with 1.11.111.110 is allowed to access the port 10255 on VPS 1.11.111.111.</li>
  </ul>
</blockquote>

<p>You could use iptables to make specific rule from you nodes, but I think it will be a challenge to manage theses rules for your service by hand... you could try but it will be really hard to manage and maintain.</p>

<blockquote>
  <p>What else do I have to consider?</p>
</blockquote>

<p>I recommend this setup for understand how to Kubernetes works and for tests purposes, but it is not production-ready, the security of your node could be compromised since you are exposed the Kubernetes ports over the internet.</p>

<p>You can consider also use kubernetes as a single node, take a look is this <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/" rel="nofollow noreferrer">link.</a></p>
