But I can see in several web resources that is not a reliable solution, just for local testing purpose.
I tried to replace them by ingress but I am a bit lost between ingress, DNS and nginx-ingress in addition to rancher component.
I understood than load balancer need a cloud provider, to have a public IP for instance, and handle the <pending> state of load balancer.
Can you highlight me on how replace port-forward in LAN without a cloud provider?
I don’t think this is considered the best way, but I have an haproxy host outside my Kubernetes cluster with a wildcard DNS pointed at it and it then points everything at the worker nodes (which are RKE2 so all have nginx-ingress-controller by default) in round robin. Then ingress can be set with any hostname within the wildcard DNS and it gets through.
You could technically put the hostnames you want to test in your local hosts file (/etc/hosts on *NIX and Windows has one too in something like C:\Windows32\CONFIG…\hosts) pointing to your haproxy and still set up the ingresses the same way. If you don’t have admin on your box if you have a VM you could try from there or even boot from a live CD/DVD.
You do need an ingress controller set up in such a way your haproxy points to still, but that’d get around your DNS issue for testing anyway and you could go through requesting actual DNS entries later.
First all all Hi, i missed it in my first post (bad use from stckovflw).
I answer late because i had to learn some sub concept. Now i want to add some informations, first to expose my need more precisely , and second to understand what you purpose.
Well, there are several things to say and it depends on what you want.
If you want to refer to things via a hostname rather than an IP, then you need DNS. If you are fine with IPs you can skip DNS.
To use an ingress, you need an ingress controller running. RKE2 runs one by default and I assume k3s does too but I haven’t used it and you might want to verify.
An ingress is used to map a Kubernetes service to some hostname and/or IP and/or port and/or URL path.
A network request for the resource has to get to a load balancer (external like HAProxy or internal like MetalLB) or an ingress controller node with the request matching the ingress rule. You can do that in a lot of ways (if you use a wildcard DNS to a load balancer then you can use hostnames, regardless you can use ports or paths, so in the simplest case if you have an ingress controller running on node 192.168.10.2 listening on port 80 & 443, then you can set an ingress for the path so that /service1 points to your service and then access it with http://192.168.10.2/service1 (or https).
You’re going to need to look at the concepts and decide what meets your needs and makes the most sense for you. Hope that helps.