<p>I can't access to public IP assigned by MetalLB load Balancer</p>

<p>I created a Kubernetes cluster in Contabo. Its 1 master and 2 workers. Each one has its own public IP. </p>

<p>I did it with kubeadm + flannel. Later I did install MetalLB to use Load Balancing. </p>

<p>I used this manifest for installing nginx:</p>

<pre><code>apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1
        ports:
        - name: http
          containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
spec:
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 80
  selector:
    app: nginx
  type: LoadBalancer
</code></pre>

<p>It works, pods are running. I see the external IP adress after:</p>

<pre><code>kubectl get services
</code></pre>

<p><a href="https://i.stack.imgur.com/LJCxH.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LJCxH.png" alt="enter image description here"></a>
From each node/host I can curl to that ip and port and I can get nginx's:</p>

<pre><code>&lt;h1&gt;Welcome to nginx!&lt;/h1&gt;
</code></pre>

<p>So far, so good. BUT:</p>

<p>What I still miss is to access to that service (nginx) from my computer. 
I can try to access to each node (master + 2 slaves) by their IP:PORT and nothing happens. The final goal is to have a domain that access to that service but I can't guess witch IP should I use.</p>

<p>What I'm missing?</p>

<p>Should MetalLB just expose my 3 possible IPs?
Should I add something else on each server as a reverse proxy?</p>

<p>I'm asking this here because all articles/tutorials on baremetal/VPS (non aws,GKE, etc...) do this on a kube on localhost and miss this basic issue. </p>

<p>Thanks.</p>

dasHannon
<p>I am having the very same hardware layout:</p>
<ul>
<li>a 3-Nodes Kubernetes Cluster - here with the 3 IPs:
| 123.223.149.27
| 22.36.211.68
| 192.77.11.164 |</li>
<li>running on (different) VPS-Providers (connected to a running cluster(via JOIN), of course)</li>
</ul>
<p><strong>Target: &quot;expose&quot; the nginx via metalLB, so I can access my web-app from outside the cluster via browser via the IP of one of my VPS'</strong></p>
<p><strong>Problem: I do not have <em>a &quot;range of IPs&quot;</em> I could declare for the metallb</strong></p>
<p>Steps done:</p>
<ol>
<li>create one .yaml file for the Loadbalancer, the <strong>kindservicetypeloadbalancer.yaml</strong></li>
<li>create one .yaml file for the ConfigMap, containing the IPs of the 3 nodes, the <strong>kindconfigmap.yaml</strong></li>
</ol>
<p>``</p>
<pre><code>### start of the kindservicetypeloadbalancer.yaml
### for ensuring a unique name: loadbalancer name nginxloady

apiVersion: v1
kind: Service
metadata:
  name: nginxloady
  annotations:
    metallb.universe.tf/address-pool: production-public-ips
spec:
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: nginx
  type: LoadBalancer
</code></pre>
<p>``</p>
<p>below, the second .yaml file to be added to the Cluster:</p>
<pre><code>    # start of the kindconfigmap.yaml
    ## info: the &quot;production-public-ips&quot; can be found 
    ## within the annotations-sector of the kind: Service type: loadbalancer / the kindservicetypeloadbalancer.yaml 
    ## as well... ...namespace: metallb-system &amp; protocol: layer2 
    ## note: as you can see, I added a /32 after every of my node-IPs

 
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: production-public-ips
      protocol: layer2
      addresses:
      - 123.223.149.27/32
      - 22.36.211.68/32
      - 192.77.11.164/32 
</code></pre>
<p>``</p>
<ul>
<li><p>add the LoadBalancer:</p>
<p><code>kubectl apply -f kindservicetypeloadbalancer.yaml</code></p>
</li>
<li><p>add the ConfigMap:</p>
<p><code>kubectl apply -f kindconfigmap.yaml  </code></p>
</li>
<li><p>Check the status of the namespace ( &quot;n&quot; ) metallb-system:</p>
<p><code> kubectl describe pods -n metallb-system</code></p>
</li>
</ul>
<p>PS:
actually it is all there:
<a href="https://metallb.universe.tf/installation/" rel="nofollow noreferrer">https://metallb.universe.tf/installation/</a></p>
<p>and here:
<a href="https://metallb.universe.tf/usage/#requesting-specific-ips" rel="nofollow noreferrer">https://metallb.universe.tf/usage/#requesting-specific-ips</a></p>
