How to Access Kubernetes Services with Public IPs through Traefik?

0
4
Asked By CuriousCat123 On

I'm new to Kubernetes and need some help! I've set up a k3s cluster using kube-vip for load balancing and created a Traefik deployment as a LoadBalancer. I got an external IP address (10.20.20.100) from kube-vip, and I can access my services through that IP without any issues. However, I've configured Traefik with a nodeSelector targeting specific nodes that have their own public IP addresses. I want to access the services using these public IPs too. Right now, it seems like only one of my ingress nodes responds when using hostNetwork. What can I do to resolve this and ensure that all ingress nodes are functioning correctly?

3 Answers

Answered By CloudNerd34 On

You should ensure that the public IP is actually assigned to the LoadBalancer, not just the node. It sounds like you're using a few VPSs, so check with your hosting provider about their network settings. Also, kube-vip has a default setting where it selects a leader node, and only LoadBalancers from that node get announced. You might want to adjust that so every LoadBalancer can select its own leader. That could be affecting your setup.

Answered By TechGuru88 On

If it's just you and a few friends or family accessing your cluster, I’d suggest setting up a Cloudflare tunnel instead. It's a safer way than exposing your cluster directly to the web.

Answered By HomeLabHero29 On

Can you clarify what you mean by public IP? Is it truly a public IP accessible from the internet, like the one your ISP assigns to your modem? If this is a homelab setup, I’m guessing those "public" nodes might not have real public IPs.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.