-1

I have a problem with setting kubernetes loadbalancer/ingress(under port 80 for example).

I don't use it with any cloud, just VPS servers with only one IP per server. I'm was trying install traefik but I don't get external-ip - it's stuck on pending.

I have read that I need something when simulating loadbalancer so I installed MetalLB but it more dedicated from local network not VPS servers and didn't work for me or I can't configure it.

My config-map for MetalLB:

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: default
  name: config
data:
  config: |
    address-pools:
    - name: default
      protocol: layer2
      addresses:
      - node1_ip
      - node2_ip
      - node3_ip

What I should do to on that cluster to be able to expose websites under normal port type 80, or can using reverse proxy like traefik.

tk421
  • 5,775
  • 6
  • 23
  • 34
rafal1337
  • 164
  • 10

1 Answers1

2

You should not put node_ip addresses to MetalLB config file. You need to modify this to match the IP scheme of the network you are connected to with subnet. LoadBalancer IP addresses will be distributed from this range.

Something like below:

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: metallb-system
  name: config
data:
  config: |
    address-pools:
    - name: metallb-system
      protocol: layer2
      addresses:
      - 192.168.1.240/28
clxoid
  • 2,577
  • 12
  • 21
  • Arriving at this now - to help those who might be thinking like @rafal1337, like I am, in order to load balance, you need to do so within a network that you own in some capacity. If you're trying to balance between external/public IP addresses, you're operating within the public internet, a space you do not own, and so MetalLB has nowhere to advertise addresses. At least this has come to be my understanding. – WoodyWoodsta Jul 15 '22 at 13:43