| Posted | Nick | Remark | |
|---|---|---|---|
| #openstack-nova - 2024-09-09 | |||
| 17:34:07 | noonedeadpunk | https://opendev.org/openstack/nova/src/branch/master/etc/nova/api-paste.ini#L20-L29 | |
| 17:34:14 | sean-k-mooney | kind of but we dont have midelware enabled by default for rewrites | |
| 17:34:25 | sean-k-mooney | its better to do that in the webserver/reverse_proxy | |
| 17:34:29 | noonedeadpunk | ah, for this - novnc - yeah, it does not | |
| 17:35:07 | noonedeadpunk | so in the webserver - yeah, that would be fine. But reverse proxies not designed for rewrites, imo | |
| 17:35:09 | sean-k-mooney | ya so the novnc proxy is useing websockify and the eventlet webserver | |
| 17:35:30 | sean-k-mooney | noonedeadpunk: tell that to kubernetes | |
| 17:35:41 | sean-k-mooney | that what ingress is | |
| 17:35:48 | noonedeadpunk | I don't think k8s is good bfor lb... | |
| 17:35:55 | noonedeadpunk | it's nginx | |
| 17:36:06 | noonedeadpunk | which is technically not a reverse proxy | |
| 17:36:16 | sean-k-mooney | its the runciton its used for however | |
| 17:36:26 | noonedeadpunk | it's a web server with hugely reduced feature list that acts as a reverse proxy | |
| 17:36:32 | sean-k-mooney | i would consier it to be both a reverse proxy and a webserver | |
| 17:36:45 | sean-k-mooney | yep but even haproxy can do this too | |
| 17:36:50 | noonedeadpunk | can it? | |
| 17:37:09 | sean-k-mooney | i belive so when used as a http loadbalbnce | |
| 17:37:12 | noonedeadpunk | As it can do maps, sure, but it's not really rewrites | |
| 17:37:27 | noonedeadpunk | so it can pass /console to correct backend | |
| 17:37:39 | noonedeadpunk | but not alter uri. I guess | |
| 17:37:41 | noonedeadpunk | not 100% sure | |
| 17:38:04 | sean-k-mooney | ya. so that is how i would personaly do it. i generall prefer using subdomain insteda of subpaths | |
| 17:38:08 | noonedeadpunk | I was actually hoping to see answer in devstack, but it's jsut using port :D | |
| 17:38:21 | noonedeadpunk | oh, yes, sure, subdomain works nicely | |
| 17:38:43 | sean-k-mooney | im currently in the process of rebuildign my home lab | |
| 17:38:45 | noonedeadpunk | jsut decided to practise on subpaths as that's what devstack does | |
| 17:38:52 | jrosser | does any of this help https://www.haproxy.com/documentation/haproxy-configuration-tutorials/http-rewrites/ | |
| 17:39:24 | sean-k-mooney | but my home openstack did everything behind traefix exposing everything over port 443 | |
| 17:39:28 | noonedeadpunk | oh | |
| 17:40:49 | sean-k-mooney | openshifts defautl ingress controller(route contoler) is haproxy and it does supprot this to at least some degree | |
| 17:42:42 | noonedeadpunk | jrosser: I guess I tried to have a look at https://www.haproxy.com/documentation/haproxy-configuration-tutorials/http-rewrites/#set-the-url-path but failed to implement so dropped this idea a while ago | |
| 17:42:54 | noonedeadpunk | but maybe for consoles it's actually worth checking | |
| 17:44:25 | sean-k-mooney | https://www.haproxy.com/documentation/haproxy-configuration-tutorials/http-rewrites/#replace-part-of-a-header-by-using-a-regular-expression | |
| 17:44:39 | sean-k-mooney | you can proably use the regex replace value funtionality | |
| 17:45:00 | sean-k-mooney | in your case set-path | |
| 17:45:05 | sean-k-mooney | is proably simpler | |
| 17:45:53 | noonedeadpunk | I've jsut tried to place novnc actually in subfolder, but then it's also failing on `wss://domain.com/?token=4741df38-cc54-4be6-b63f-1d7b7b1b336d` | |
| 17:46:12 | noonedeadpunk | as somehow wss is not adjusted or trimms subpath /o\ | |
| 17:47:05 | noonedeadpunk | and that I'm even not sure how to catch | |
| 17:57:47 | noonedeadpunk | so eventually what creates wss should also pass a path | |
| 17:57:59 | noonedeadpunk | or at least respect passed one | |
| 17:58:49 | sean-k-mooney | well you would need to also rewrite it | |
| 17:59:18 | noonedeadpunk | it's tough to rewrite just /?token given that / is serving horizon | |
| 17:59:29 | noonedeadpunk | but yeah | |
| 18:00:37 | noonedeadpunk | I'd say there should be code in place respecting passed URIs when returning wss | |
| 18:00:54 | sean-k-mooney | unfortuetly i dont have a config to had for that. i tought i had that working in my previous home cloud. i.e. the one i had pre 2020 | |
| 18:01:19 | sean-k-mooney | but my current one is forwarding 6080 and everything else was using subdomains | |
| 18:02:07 | noonedeadpunk | yeah, I managed to get it working with subdomain jsut out of the box | |
| 18:04:36 | noonedeadpunk | but then it's a bit tougher with let's encrypt as for wildcards I'd need dns-01 | |
| 18:15:16 | sean-k-mooney | yep thats what i use now although before i didnt use wildcards i added a dns entry for each serice | |
| 18:15:48 | sean-k-mooney | i use cloudfail as my dns provider mainly for there restapi adn the fact it supproted in a lot of things | |
| 18:16:54 | sean-k-mooney | *cloudflare | |
| 18:18:33 | noonedeadpunk | well. these are quite long-shot workarounds for smth which should be just possible to do quite simply. And I have pretty much everything working with subpaths except console... | |
| 18:20:03 | sean-k-mooney | honestly none of this is inscope of nova | |
| 18:20:38 | sean-k-mooney | noonedeadpunk: a webseocket is just a upgradded http connection | |
| 18:20:59 | sean-k-mooney | my guess is haproxy does not offcially supprto them or apply the rewite to them | |
| 18:21:08 | noonedeadpunk | yes, but it's https://opendev.org/openstack/nova/src/branch/master/nova/console/websocketproxy.py which replies with wss URL I assume? | |
| 18:22:18 | noonedeadpunk | as when I open novnc under specific path, and it fully loads (I reached this point), now I assume nova provides wss url that is not under same path at all | |
| 18:22:50 | noonedeadpunk | So I'd argue about scope here | |
| 18:22:54 | sean-k-mooney | we ues a websocket between the proxy and the html5 applciation that part of novnc | |
| 18:23:40 | noonedeadpunk | yeah, but it's created with no respect to where html5 is running I assume? | |
| 18:24:01 | noonedeadpunk | as it always thinks it runs in `/` | |
| 18:24:02 | sean-k-mooney | the websocket is created regardless yes | |
| 18:24:12 | sean-k-mooney | but we do not supprot subpaths | |
| 18:24:23 | sean-k-mooney | we only supprot runing it on a port | |
| 18:24:31 | sean-k-mooney | anythign beyond that is out so scope | |
| 18:25:25 | noonedeadpunk | so regardless of any rewrites, except trying to catch some GETs under `/` which is really weird - it won't work, yes | |
| 18:26:13 | sean-k-mooney | i belive it can be made work if you rewirte teh websocet too | |
| 18:26:25 | sean-k-mooney | https://www.haproxy.com/documentation/haproxy-configuration-tutorials/load-balancing/websocket/#configure-websockets ha porxy has some supprot for this | |
| 18:26:28 | noonedeadpunk | but then what's the whole point of devstack to be serving services under subpaths.... | |
| 18:26:54 | sean-k-mooney | to avoid using domain | |
| 18:27:15 | noonedeadpunk | yeah, but jsut use ports as used to - would be way more simple to configure... | |
| 18:27:16 | sean-k-mooney | that it we wanted to test that we can run all the rest apis over https on port 4434 | |
| 18:27:25 | sean-k-mooney | *443 | |
| 18:27:47 | sean-k-mooney | there is nothing stoping you using ports | |
| 18:28:00 | sean-k-mooney | btu we did have a lot of operator want to run everything on 443 | |
| 18:28:01 | noonedeadpunk | *all except consoles | |
| 18:28:08 | sean-k-mooney | you can run the console on 443 | |
| 18:28:25 | noonedeadpunk | (that is not tested in devstack) | |
| 18:28:34 | noonedeadpunk | https://zuul.opendev.org/t/openstack/build/092ca27659d5466aa3c19120b58b5031/log/controller/logs/etc/nova/nova-cpu_conf.txt#152-158 | |
| 18:28:38 | sean-k-mooney | sure but devstack does not test everything | |
| 18:28:57 | noonedeadpunk | I can recall some tempest tests for consoles? | |
| 18:29:26 | sean-k-mooney | there are some yes | |
| 18:29:45 | sean-k-mooney | its not that devstack could not test this | |
| 18:29:58 | sean-k-mooney | its that its not in scope to test every combination of how openstack is deployed | |
| 18:30:04 | noonedeadpunk | yeah, fair | |
| 18:30:09 | noonedeadpunk | that I agree with | |
| 18:30:48 | noonedeadpunk | I guess I just not fully in agreement that serving consoles under subpath should be out of scope of nova-novncproxy service | |
| 18:31:14 | sean-k-mooney | for our new installer we deploy novnc on a subdomain | |
| 18:31:17 | sean-k-mooney | https://logserver.rdoproject.org/57/857/e3248dbf95dfb1878d852beef4475bfb68f4e811/github-check/nova-operator-tempest-multinode/616a00d/controller/ci-framework-data/logs/openstack-k8s-operators-openstack-must-gather/namespaces/openstack/routes/nova-novncproxy-cell1-public.yaml | |
| 18:32:16 | noonedeadpunk | yeah, subdomain works really nicely.... | |
| 18:32:45 | noonedeadpunk | ok, gotcha | |
| 18:32:48 | sean-k-mooney | yep so again using subpath need a reversproxy that support both http and websockets | |
| 18:32:58 | sean-k-mooney | as in it need to be able to rewirte both properly | |
| 18:33:15 | sean-k-mooney | it might be posibel to do some other way | |
| 18:33:16 | noonedeadpunk | the problem here of reverseproxy, that then you can't serve anything on root | |
| 18:33:36 | noonedeadpunk | so if you want to have smth like skyline/horizon on root - you can't do that jsut because of vnc console | |
| 18:33:53 | sean-k-mooney | right but normally you sever that on /dashboard | |
| 18:33:59 | sean-k-mooney | and have a redirect for root to it | |
| 18:34:39 | noonedeadpunk | but then redirecting is also fishy a bit, as you need to account for wss | |