Friday, 2024-04-05

opendevreviewGregory Thiemonge proposed openstack/octavia master: Add spec for custom SGs on VIP ports  https://review.opendev.org/c/openstack/octavia/+/91511407:49
feld1How do you express the haproxy configuration "http-request redirect scheme https" with Octavia? 17:39
*** feld1 is now known as feld17:40
johnsomFor TERMINATED_HTTPS load balancers, that is added automatically17:42
feldTERMINATED_HTTPS is the protocol of the listener, not the load balancer. It doesn't automatically listen on port 80 from what I'm seeing17:44
johnsomCorrect, you have to add a listener to define a port to listen on17:44
feldI've been googling for hours trying to find some example of this being implemented or how this works and it's impossible to find :( 17:45
johnsomhttps://docs.openstack.org/octavia/latest/user/guides/l7-cookbook.html#redirect-http-www-example-com-to-https-www-example-com17:46
feldthat documentation is wrong lol i was about to report that too17:46
johnsomOur cookbooks in the user guide have a bunch of examples for different scenarios17:46
feldthe cli commands do not at all reflect the solution above17:46
feld> Set up an L7 Policy policy1 on http_listener with action REDIRECT_TO_URL pointed at the URL https://www.example.com/17:47
feldopenstack loadbalancer l7policy create --action REDIRECT_PREFIX --redirect-prefix https://www.example.com/ --name policy1 http_listener17:47
feldWhy is it giving an REDIRECT_PREFIX action when that's not what was discussed in the solution?17:47
johnsomYeah, I see that typo. We have both URL and PREFIX as options. URL is full path, PREFIX is just the start17:48
feldand this is L7 policy/rule solution which doesn't match the initial answer you provided here about it being automatic17:48
feldthese L7 rules won't work at all because it requires hardcoding domains in there so if you have a wildcard certificate or multiple domains on a cert... nowhere do the docs demonstrate you can use variables in the REDIRECT_URL 17:49
feldI appreciate that there's an IRC channel here and people around to answer silly questions like this, so thank you sooooo much, really! 17:50
johnsomYou cannot use variables in REDIRECT URL. If you are using SNI, redirect to the IP address17:50
johnsomBut, actually, I see what you are saying.17:55
johnsomFunny that scenario hasn't come up in all of these years, people have used the redirect_prefix17:57
johnsomOk, I think we should have a simpler solution for this. If you want to open an RFE that would be cool.17:57
johnsomIn the mean time, it can be done with building L7rules that matches your domain(s) such that it maps to the right redirect_prefix17:58
johnsomThat won't help with wildcard certs though.17:58
feldyeah I have to make this work with a wildcard cert17:59
feldRFE -- do you mean opening a bug report at the bug tracking in the /topic? O18:00
feld*bug tracking URL18:00
johnsomYes18:00
johnsomA request for enhancement18:00
feldand to confirm: I did add a listener for port 80 with the other listener doing TERMINATED_HTTPS on port 443, pool member(s) configured for port 80, and it does not automatically do the HTTPS redirect18:03
johnsomYeah, the redirect is automatic on port 443 in that case, the TERMINATED_HTTPS. So if you connect to 443 using HTTP it redirects.18:05
johnsomThat is the only place I found in the code that uses that scheme18:05
feldsure, but nobody is going to connect to 443 with HTTP from their browsers :) 18:07
felddoes this mean it's possible to configure the port 80 as TERMINATED_HTTPS? 18:08
feldI guess I didn't try that as it didn't seem logical18:08
johnsomYeah, actually, that would work18:08
johnsomI still think we should have an RFE to add a listener protocol to make this much more straight forward.18:10
feldNope, that won't work. TERMINATED_HTTPS errors because I'm not providing the certificate container18:10
feldso we really do need an RFE to solve this18:10
johnsomYeah, just give it the same container ID as your 443 listener18:11
feldoooh? i figured it would try speaking HTTPS on that port then18:11
johnsomNo, it will do what you want18:11
feldIt's giving me an empty reply and closing the connection when I test it with curl18:13
johnsomcurl with --head18:13
feldcorrect, i've tried with and without and capturing the debug output too18:13
johnsomwhat is the output?18:13
feldlet me put this on a pastebin for you18:14
johnsomhttps://paste.opendev.org/18:14
johnsomIt should be sending back a 302 found redirect18:14
feldhttps://dpaste.com/8E8T5DYNZ18:15
johnsomOk, that is super odd, it should always return something. 18:18
johnsomI will need to setup this scenario to test/debug. That is not the behavior I would expect given the config code.18:18
johnsomGive me 30 to set up a test environment18:19
feldyeah I was expecting the 302 as well 18:19
feldhttps://dpaste.com/GH7ECX9WD18:19
feldif Terraform is something you can work with i can paste you a minimal config18:20
johnsomNo thanks, I have my own tools18:20
johnsomI see there is a TCP 80 listener, is that bound to an L7 policy still?18:21
johnsomIf it's hitting that listener, I could see it getting an empty response18:22
feldI do not have any L7 policies deployed at this time18:23
feld"openstack loadbalancer l7policy list" returns empty as I expected18:24
johnsomYeah, ok, I can reproduce that.18:52
johnsomSSL handshake failure18:52
johnsomAnd I see why18:54
johnsomSorry, that work around isn't going to work.18:54
feldok, do you want me to proceed with filing an RFE or do you have enough information to open one internally?19:01
feldif you open one I'd like to subscribe to the issue anyway19:01
johnsomIt would be great if you could open one. It helps with prioritization if it's from a user instead of the core team. https://bugs.launchpad.net/octavia19:02
johnsomAlso, if we add this feature in Dalmatian, would you pull it down and use it, or do you need to wait for a release? 19:02

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!