<p>I'm fairly new to this but I'm setting up a multi-master, high availability Kubernetes cluster of at least 3 masters and a variable number of nodes. I'm trying to do this WITHOUT the use of kube-spray or any other tools, in order to learn the true ins-and-outs. I feel I have most of it down except one bit:</p>

<p>My understanding is:</p>

<ul>
<li>A NodePort allocates a port to a specific service</li>
<li>A Load Balancer is an external resource that allows for external access</li>
<li>An Ingress Controller allows you to configure specific paths to services and ports.</li>
</ul>

<p>Some points about my cluster:</p>

<ul>
<li>The pods I deploy can run on any machine in the cluster and don't need to be externally accessible. </li>
<li>My masters are also worker nodes and can run pods</li>
<li>etcd runs on each master</li>
</ul>

<p>My question is, do I need a NodePort/LB/Ingress Controller? I'm trying to understand why I would need any of the above. If a master is joined to an existing cluster alongside another master, the pods are distributed between them, right? Isn't that all I need? Please help me to understand as I feel I'm missing a key concept.</p>

Dan
<p>First of all NodePort, LoadBalancer and Ingress has nothing to do with the setting up kubernetes cluster. These three are tools to expose your apps to the outside world so that you can access those apps from outside the kubernetes cluster.</p>

<p>There are two parts here:</p>

<ol>
<li>Setting up the highly available kubernetes cluster with three masters. I have written a blog on it, how to setup a multi-master kubernetes cluster, it will give you brief idea about how to setup multi master cluster in kubernetes.</li>
</ol>

<blockquote>
  <p><a href="https://velotio.com/blog/2018/6/15/kubernetes-high-availability-kubeadm" rel="nofollow noreferrer">https://velotio.com/blog/2018/6/15/kubernetes-high-availability-kubeadm</a></p>
</blockquote>

<ol start="2">
<li>Now once you have your kubernetes cluster ready, you can start deploying your applications on it (pods,services etc.). Those application you deploy might needs to be exposed to outside world, for example a website hosted on your kubernetes cluster and needs to be accessed from internet. Then these NodePort, Loadbalancer or Ingress comes into the picture. The difference between NodePort, LoadBalancer and Ingress and when to use what? is explained very well in this article here.</li>
</ol>

<blockquote>
  <p><a href="https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0" rel="nofollow noreferrer">https://medium.com/google-cloud/kubernetes-nodeport-vs-loadbalancer-vs-ingress-when-should-i-use-what-922f010849e0</a></p>
</blockquote>

<p>Hope this gives you some clarity.</p>

<p>EDIT: This edit is for kubeadm config file for 1.13(see comments)</p>

<pre><code>apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
kubernetesVersion: stable
apiServer:
  certSANs:
  - "VIRTUAL IP"
controlPlaneEndpoint: "VIRTUAL IP"
etcd:
    external:
        endpoints:
        - https://ETCD_0_IP:2379
        - https://ETCD_1_IP:2379
        - https://ETCD_2_IP:2379
        caFile: /etc/kubernetes/pki/etcd/ca.crt
        certFile: /etc/kubernetes/pki/apiserver-etcd-client.crt
        keyFile: /etc/kubernetes/pki/apiserver-etcd-client.key
</code></pre>
