Open dbalabka opened 10 months ago
To fix the issue, aiohttp
needs to support the path in base_url
: https://github.com/aio-libs/aiohttp/issues/6647
It works for me in my patched version.
Would you mind opening an issue upstream in kr8s
for this? Preferably with a small example we can use to reproduce the issue (I know we would need Rancher but the snippet that reproduces on your end would still be useful).
@jacobtomlinson , I think the simplest way to reproduce the problem is to put k8s API behind the proxy and add an extra path (proxy http://127.0.0.1/somepath
to http://127.0.0.1
) and adjust kubectl
settings. The Nginx reverse proxy_pass
rule can help:
location /somepath {
proxy_pass http://127.0.0.1
}
It looks like kubectl
can handle this for you.
$ kubectl proxy --api-prefix=/somepath/
Starting to serve on 127.0.0.1:8001
$ curl localhost:8001/somepath/version
{
"major": "1",
"minor": "29",
"gitVersion": "v1.29.0",
"gitCommit": "3f7a50f38688eb332e2a1b013678c6435d539ae6",
"gitTreeState": "clean",
"buildDate": "2023-12-14T19:18:17Z",
"goVersion": "go1.21.5",
"compiler": "gc",
"platform": "linux/amd64"
}
While digging into this I've noticed some other strange behaviour when the Kubernetes API is proxied with an extra path. I opened https://github.com/kr8s-org/kr8s/issues/284 to track.
Describe the issue: Deploy k8s cluster in a rancher. Try to connect with default settings. You will see:
because Rancher provides the following URL to connect to websockets:
https://rancher.example.com/k8s/clusters/c-m-4wx4gzpx
Minimal Complete Verifiable Example:
TBD
Anything else we need to know?:
Environment: