-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
Talk to k8s API via http(s) proxy #245
Comments
Hey there, thanks for digging into this. Hey there, yeah our As this is a reqwest::ClientBuilder option, it should sit inside our Long term, we were hoping to be able to lift the Client outside this module (maybe via #100), so that we didn't have to duplicate client options just to pass them on to the thing that really handled it (as well as forcing reqwest on everyone). But doing that change is probably a more difficult piece of work, so if you have a need for proxy, am happy to take a PR that just plants this into |
This is now released in kube 0.35.0. |
This commit adds method `Config::proxy` that allows setting proxy to use when talking to Kubernetes API. Fixes kube-rs#245
For anyone stumbling across this: This has been removed again in version 0.49 due to the move from reqwest to Tower. |
It should be still possible by implementing a custom service, but it's too painful at the moment because all the layers are private (you'll need to recreate the entire stack manually and use that to create We should be able to add an optional proxy layer using |
Thank you @kazk - I don't really need this feature. I just tried to put a mitmproxy in between so I can debug some issues I've seen. I really just commented here so others don't sumble across the same thing I did. This was the first issue that poppepd up for me when searching on Google for kube-rs and proxy and it wasn't obvious that this has been removed again. I can try your PR but I can only get to it next week. |
First of all, thanks a lot for this work. Using k8s via a generic API powered by Rust type system is a pure pleasure!
I just started using this library for a pet project, and I could not find how to make kube-rs talk to k8s API via a http(s) server. And judging from the code, it doesn't seem possible
https://github.com/clux/kube-rs/blob/master/kube/src/client/mod.rs#L320-L338
Adding support for http(s) proxy (and for the fact, any kind of proxy, reqwest supports many more) seems pretty simple implementation-wise, we just need to set
proxies
vector in theClientBuilder
.However, I've no idea how exactly we can expose this on kube-rs API level.
If I understand the codebase correctly,
Config
struct seems to be a one-stop entity to configure kube-rs, it addresses mixed concerns: we have namespace for kubernetes and headers for the http transport. Would you say, that adding another fieldproxy
to theConfig
struct is a viable option? Or do you see a better way for configuring proxy server?The text was updated successfully, but these errors were encountered: