I'm running a Kubernetes cluster using VirtualBox and Vagrant on my local machine. I'm trying to assign an IP address to my services so I can access them directly from my host machine. When I'm working in the cloud, I can easily create a LoadBalancer and get an external IP, but I'm not sure how to achieve this on my local setup. Any suggestions?
4 Answers
You can use MetalLB or LoxiLB as options for providing an external IP to your LoadBalancer services. I've found them helpful in local environments.
I personally use PureLB because it’s straightforward, but I’m curious if anyone’s had success with LoxiLB?
Cilium can also provide external IP capabilities in a local setup, so that's worth a look!
If you're exploring alternatives, consider using Nomad instead of Kubernetes. Keepalived might be a good option for assigning a floating IP to your ingress nodes.
Yeah, MetalLB is specifically designed for Kubernetes if you decide to stick with it.
Make sure you have an ingress controller set up. If you do, you can create a NodePort service or use MetalLB. Alternatively, for testing, `kubectl port-forward` is useful to access your services without further configuration.
I tried MetalLB, but I had issues with getting the routes to work right from my host machine.