Skip to content
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

Proxy support #825

Open
rocketraman opened this issue Jul 28, 2020 · 7 comments · May be fixed by #2675
Open

Proxy support #825

rocketraman opened this issue Jul 28, 2020 · 7 comments · May be fixed by #2675
Labels
enhancement New feature or request

Comments

@rocketraman
Copy link

rocketraman commented Jul 28, 2020




Is your feature request related to a problem? Please describe.
Some clusters require proxies in order to access their APIs. Most notably, GKE clusters with private networking. When using kubectl, one can work around this by setting the https_proxy variable for specific commands. However, with k9s I don't see any way to connect to a cluster via a proxy (edit, per a comment in #371 the slightly non-standard uppercase HTTPS_PROXY does work).

However, the https_proxy / HTTPS_PROXY env var for k9s is not ideal as different clusters often need different proxies, and this approach does not allow switching contexts that need a different proxy (or no proxy) without restarting k9s with the appropriate environment.

Describe the solution you'd like
I'd love a way to configure a proxy on a per-context basis. Lens supports this, for example.

Describe alternatives you've considered
I don't have any alternatives.

Additional context
Kubectl 1.19+ has the ability to configure proxies via kube config: kubernetes/client-go#351. Its likely any solution in k9s should first use this setting, and only fall-back to a k9s-native proxy configuration mechanism.

@derailed derailed added the enhancement New feature or request label Jul 29, 2020
@xens
Copy link

xens commented Aug 9, 2021

Looks like that this is now working out-of-the-box, tested on v0.24.15.

@MichaelHindley
Copy link

MichaelHindley commented Aug 15, 2022

After updating to v0.26.3 from v0.25.*, the proxy functionality seems broken, when choosing a cluster to connect to results in "Unable to connect to context".
kubectl commands in the same terminal work fine, and v0.25 works fine too.

edit: this is for proxy set using HTTPS/HTTP_PROXY.

@thewilli
Copy link

Should we create a dedicated issue to support the proxy-url field in a kubeconfig instead?

It seems to solve this issue but is more explicit regarding the actual steps required.

@nrekretep
Copy link

I am having this problem, too.

kubectl works just fine with the proxy settings (via env vars) in the same terminal.
Any chances that this will get fixed soon?

Thank you!

@CJCShadowsan
Copy link

CJCShadowsan commented Aug 8, 2023

I'll add a "me too" to this - Defining in a kubeconfig works fine, k9s? Nope.

If I run the command with HTTPS_PROXY defined to a socks5 proxy, that works - But it would be good for k9s to support the same kubeconfig mechanism that kubectl does, i.e. proxy-url

@BlackDex
Copy link

BlackDex commented Feb 8, 2024

Not sure what the status of this issue is. But socks5:// seems to work indeed. Only socks5h:// isn't.
The h means sending dns requests also via the socks5 proxy.

@placintaalexandru
Copy link
Contributor

Hello,

I'll try to work on this one. I looked at the code and so far I can make k9s to interact with a basic http proxy I hardcoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants