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

Support proxy-url from ~/.kube/config #2468

Open
flybyray opened this issue Jun 23, 2022 · 12 comments · May be fixed by #2504
Open

Support proxy-url from ~/.kube/config #2468

flybyray opened this issue Jun 23, 2022 · 12 comments · May be fixed by #2504
Labels
Milestone

Comments

@flybyray
Copy link

Environment
VS Code version: 1.68.1
OS: win32
Extension version: 0.4.0
Description

I have setup proxy-url in ~/.kube/config.

apiVersion: v1
clusters:
- cluster:
    proxy-url: socks5://localhost:1080

Usage description: https://kubernetes.io/docs/tasks/extend-kubernetes/socks5-proxy-access-api/#client-configuration

This works as it should with oc from command line.

~ $ oc version
Client Version: 4.10.0-0.okd-2022-06-10-131327
Server Version: 4.8.17
Kubernetes Version: v1.21.1+6438632

But the extension is not using this property.

@dgolovin
Copy link
Collaborator

@flybyray thank you for reporting this. I tested kubectl, oc and odo in exactly the same environment.

oc and odo does not support proxy-url in ~/.kube/config as you mentioned above, but they do support https_proxy env variable.
kubectl supports both ways.

Workaround: set https_proxy env manually and then restart vscode.

Fix: set https_proxy env var when running oc or odo if current context has proxy-url property set.

@dgolovin dgolovin added kind/enhancement New feature or request priority/major labels Jun 30, 2022
@flybyray
Copy link
Author

flybyray commented Jul 1, 2022

@dgolovin thx i know such workarround but it is not applicable for all use cases, because in this case even vscode + extensions use it and hence things do not work as expected anymore.
with proxy-url the proxy will only be used selective for this specific tool.

@dgolovin dgolovin added this to the 0.6.0 milestone Jul 3, 2022
@dgolovin
Copy link
Collaborator

dgolovin commented Jul 3, 2022

@flybyray thank you for pointing that out. I'm setting higher priority for this issue.

@mohitsuman
Copy link
Collaborator

Fixed by #2502

@dgolovin dgolovin reopened this Aug 9, 2022
@dgolovin
Copy link
Collaborator

dgolovin commented Aug 9, 2022

@mohitsuman no it it was related to the issue, but not an actual fix.

@dgolovin
Copy link
Collaborator

dgolovin commented Aug 9, 2022

@flybyray @mohitsuman It cannot be fixed for several reasons. I did my best to workaround what I could, but it didn't work.
Here are the problems:

  1. Official @kubernetes/nodejs-client does not aware of proxy-url property for a cluster and when I use it to load configuration the proxy-url property is just ignored and not loaded.
  2. I was developing workaround for it which would just search for this property through the config files, but 'oc' and 'odo' removes it during login command call.

Basically nether official javascript client nor openshift oc/odo cli are supporting this use case.

@flybyray
Copy link
Author

oc supports it see the description. I tested it.

Hence i understand that this extension will not support it if it is not base on oc.

@dgolovin
Copy link
Collaborator

@flybyray let me check latest oc version to confirm.

@dgolovin
Copy link
Collaborator

dgolovin commented Aug 10, 2022

@flybyray this issue #1925534 describes what I see locally.

@dgolovin
Copy link
Collaborator

@flybyray probably I can workaround oc login issue, by getting proxy-url before 'oc login' then adding it back. But any 'oc login' calls outside of vscode will remove proxy-url anyway.

@flybyray
Copy link
Author

flybyray commented Aug 10, 2022

@flybyray this issue #1925534 describes what I see locally.

ok now i understand. than it is only possible to have oc invocation modification to add https_proxy environmentvariable to the process all the time. :-(
maybe some path to a wrapper oc

@dgolovin
Copy link
Collaborator

Related issue in @kubernetes/nodejs-client package kubernetes-client/javascript#853.

@dgolovin dgolovin modified the milestones: 0.6.0, 0.7.0 Aug 24, 2022
@mohitsuman mohitsuman modified the milestones: 0.7.0, 0.8.0 Aug 24, 2022
@mohitsuman mohitsuman modified the milestones: 1.2.0, 1.3.0 Jan 4, 2023
@mohitsuman mohitsuman modified the milestones: 1.3.0, 1.5.0 Mar 23, 2023
@mohitsuman mohitsuman removed this from the 1.6.0 milestone Jun 2, 2023
@mohitsuman mohitsuman added this to the 1.7.0 milestone Jun 2, 2023
@mohitsuman mohitsuman modified the milestones: 1.7.0, 1.8.0 Jul 19, 2023
@datho7561 datho7561 modified the milestones: 1.8.0, 1.9.0 Sep 14, 2023
@mohitsuman mohitsuman modified the milestones: 1.9.0, 1.10.0 Sep 25, 2023
@mohitsuman mohitsuman modified the milestones: 1.10.0, 1.11.0, 1.12.0 Nov 1, 2023
@mohitsuman mohitsuman modified the milestones: 1.13.0, 1.14.0 Apr 2, 2024
@mohitsuman mohitsuman modified the milestones: 1.15.0, 1.16.0 May 30, 2024
@mohitsuman mohitsuman modified the milestones: 1.16.0, 1.17.0 Jun 27, 2024
@mohitsuman mohitsuman modified the milestones: 1.17.0, 1.19.0 Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants