I'm new to containerization and I'm trying to get Kubernetes up and running for a game server—specifically, I'm working with Valheim. I've set up a Kubernetes cluster on a Hyper-V platform with a control plane and two worker nodes, but I'm struggling with the networking part. I've installed kubectl, kubelet, and helm, and I can see my nodes and pods. However, I'm stuck on how to get my service to work correctly with UDP ports 2456 and 2457. I thought I needed something like MetalLB for load balancing, but I'm unsure how to configure it properly. What steps can I take to troubleshoot this issue? Am I missing something critical in the setup that connects my service to the game server? Any advice would be greatly appreciated!
1 Answer
You're on the right track! Just remember that Kubernetes won't provide a built-in load balancer by itself; it relies on plugins like MetalLB to make that connection. If your MetalLB is configured correctly, you should create a LoadBalancer service that points to your Valheim server pod. Check the MetalLB documentation for labeling your service correctly, and you should be good to go! Also, the traffic gets directed to the pod randomly, so keep that in mind!

If you're having trouble understanding how it works, I found a great visual explanation ages ago that really helped me. It's a good resource for anyone new to k8s! Check it out and see if it clears things up for you.