I have bare-metal deployed Kubernetes cluster on VMware vSphere private cloud.
Spec:
When I simply add deployment:\
kubectl create deployment nginx --image k8s.gcr.io/nginx:latest
And exposed it:\
kubectl expose deployment nginx --type=LoadBalancer --port=80
All seems good. Service got ExternalIP from MetalLB pool:\
nginx LoadBalancer 10.96.56.118 198.168.50.152 80:32325/TCP 4s
New ip address published on kube-ipvs0 interface:
kube-ipvs0: <BROADCAST,NOARP> mtu 1500 qdisc noop state DOWN group default\ ...\ inet 198.168.50.152/32 scope global kube-ipvs0\ valid_lft forever preferred_lft forever\ ...
But I cant get access to service from all K8s nodes trought ExternalIP, and also from other LAN, curl returns:\
curl: (7) Failed to connect to 192.168.50.152 port 80: No route to host
ClusterIP works good, I can access it from node.
Solution is: Your Virtual Machines and services must be in different subnets. In my case I have 192.168.50.0/24 network and I split it to 2 subnets 192.168.50.0/25 - for virtual machines and 192.168.50.128/25 for MetalLB services.