-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support service type Load-Balancer #79
Comments
We probably don't even log a warning when someone uses "Type: LoadBalancer". I will send in a patch to do proper logging. |
Reported-at: #79 Signed-off-by: Gurucharan Shetty <[email protected]>
Ouch, I just spend a couple of hours trying to debug my broken services that I had setup for ingress, until I just found this issue. Is there any plan to fix this soon or is this a larger issue. What is the recommended way to setup ingress with OVN-Kubernetes? |
So, I know that ingress works with ovn-kubernetes because the guys at openshift and vmware have previously confirmed it. I have never set it up. So, I don't really understand why service type load-balancer is important for ingress to work. My understanding is that
@dcbw can add more color or correct me. |
@shettyg There are several ways to setup ingress. With a service of type load balancer Kubernetes will automatically deply an AWS Classic Load Balancer that forwards traffic to a service port. On the service port you could then have an ingress controller listening, such as traefik. Once that is setup, you can create Another way that I tried was to use the aws-alb-ingress-controller, it also registers a classic load balancer but it will forward traffic to a service of type node port and automatically updates the load balancers target groups if nodes change. I have not yet attempted to run a pod with host network enabled, that would be essentially the same as a service of type node port, but without the indirection that services provide. So I am essentially tying my ingress to a specific node (which could be a problem if that node dies or the pod gets scheduled to a different node). Please, correct me if that statement is wrong. |
I still do not understand how it works. What is a service port? An example? Is it an IP:port? Is traefik running in a pod or host? So the first step is for traffic to reach traefik. I would like to understand that first. And wondering, how is it that OVN prevents it.
I think, there is usually 2 pods running in 2 nodes (with specific node selector added when deploying pod). Not sure how the HA is enforced. |
@shettyg My understanding is that a Traefik is running in a pod. I configure it to expose its public listening port as a service of type load balancer. Kubernetes will then provision an AWS LoadBalancer that targets the node port of the traefik service. The flow of traffic is then like this:
|
Here is some more example, if I deploy my traefik ingress controller then I get the following service (
Next I check on the Linux node if ovs knows about the node ports that the service opens (e.g. with
|
@shettyg https://github.com/openvswitch/ovn-kubernetes/blob/master/go-controller/pkg/ovn/service.go#L58 Given that service type LoadBalancer is essentially just a service type NodePort, with some additional extra bits, I am wondering if it would just be enough to extend the logic to include |
That is because, I simply did not understand what "LoadBalancer" service is - in spite of trying to read about it multiple times.
With service type nodeport, we add an LB entry in OVN database for every OVN gateway (which could mean every node). Looks like for ServiceTypeLoadBalancer, we should only do it for specific nodes? |
Reading, your comment, it looks like I misunderstood. Looks like what you are saying is that, it is the same as NodePort. You can simply expand the checks in code for ServiceTypeNodePort and see whether it solves your issue. If it does, we can look at adding it to code officially. |
@lanoxx I think we already handle what you are looking for. We handle ExternalIPs for a service in handleExternalIPs(). This method adds a LoadBalancer entry (mapping External IP to NodePort IPs) on the first L3 gateway router (the one with IP address 100.64.1.2). |
Does running following command on your setup return anything? If it does return an entry, then on that L3 gateway router we should have created a load balance entry mapping ExternalIP to NodePort IPs. Also, AFAIK OVS doesn't support adding DNS names for physical IP. In your case External-IP is af00174b939a011e9ba19022b2e3974d-2088150912.eu-central-1.elb.amazonaws.com. |
This did work to some degree and partially solved my problem. I searched through the code for all occurences of @girishmg I don't quite understand the mechanism you are describing, but I think we are talking about two different things. Kubernetes supports a special service type called The mechanism you are suggesting seems to be about something that OVN supports by itself. Where can I read more about that? |
Can you access the pod from linux minion's nodeport? |
Yes. The pod that I am trying to access is a Here is an example. The LoadBalancer service exposes a traefik reverse proxy which runs on port
The traefik reverse proxy forwards requests to the Kubernetes dashboard which runs on the Linux Minion (e.g. 172.33.69.225):
When I access the NodePort of the Linux Minion (e.g.
If I try the same from the Windows node (e.g. |
Is this a problem just for LoadBalancer or does regular NodePort not work from Windows either? |
I have a |
I think this was fixed by commit: 9b9d146 |
It wasn't clear to me while experiment with this that
Type: LoadBalancer
is not supported so leaving this here in the hopes of helping someone hitting the same issue.The text was updated successfully, but these errors were encountered: