kind icon indicating copy to clipboard operation
kind copied to clipboard

Unable to find a approach to using LoadBalancer on mac m1/2

Open zesiar0 opened this issue 1 year ago • 3 comments

I have tried the following two guides, but it's still not working for me https://kind.sigs.k8s.io/docs/user/loadbalancer/ https://www.thehumblelab.com/kind-and-metallb-on-mac/

So is it any ways to use LoadBalancer on mac m1/m2 ?

zesiar0 avatar Jan 17 '24 08:01 zesiar0

I also tried MetalLb (mac m1) but as it seems (from forums I read) docker does not expose it's network on mac. That's why it's not possible. Still looking for ideas to implement load balancers in my local machine.

ashraf-minhaj avatar Jan 18 '24 08:01 ashraf-minhaj

On macOS and Windows, docker does not expose the docker network to the host. Because of this limitation, containers (including kind nodes) are only reachable from the host via port-forwards, however other containers/pods can reach other things running in docker including loadbalancers. You may want to check out the Ingress Guide as a cross-platform workaround. You can also expose pods and services using extra port mappings as shown in the extra port mappings section of the Configuration Guide.

kundan2707 avatar Jan 31 '24 04:01 kundan2707

Also very rough and WIP: https://github.com/kubernetes-sigs/cloud-provider-kind, theoretically eventually this may bridge that gap.

If you use metallb on a mac you'll be limited to interacting with it from within the docker VM because of limits in docker networking, as noted int he guide.

More recently there is this suggestion https://github.com/kubernetes-sigs/kind/issues/3448 but we haven't had a chance to review it

BenTheElder avatar Feb 01 '24 23:02 BenTheElder