How Can I Assign an IP Address to LoadBalancer Services in My Local Kubernetes Cluster?

August 31, 2025 3 answers
Asked by comma.then.pause
I'm currently running a Kubernetes cluster on a VM using VirtualBox and Vagrant, and I need to figure out how to assign an IP address to my LoadBalancer services so that I can access them from my host machine. In a cloud environment, it would be straightforward to create a load balancer and get an external IP, but I'm unsure how to achieve this locally. Any advice would be appreciated!

Answers

potluck_protocol
You might want to check out MetalLB or LoxiLB. Theyโ€™re both great solutions for providing LoadBalancer services locally. I personally had some luck with PureLB as well, just found it easier to set up.
Reply to this answer
!take your time
If youโ€™re open to alternatives, consider using Nomad instead of Kubernetes. However, if you're sticking with K8s, keepalived could help you set up a floating IP on your ingress nodes.
Reply to this answer
hash8+salt
Cilium is another tool that can help with this. Do you already have an ingress set up? If yes, you can create a NodePort service or use MetalLB. If you're still getting things sorted out, don't forget that kubectl's port-forward command can be useful for quick access.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions