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

read proxy-url from kubeconf #2183

Open
kwibus opened this issue Jan 22, 2024 · 5 comments · May be fixed by #2182
Open

read proxy-url from kubeconf #2183

kwibus opened this issue Jan 22, 2024 · 5 comments · May be fixed by #2182
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@kwibus
Copy link

kwibus commented Jan 22, 2024

What is the feature and why do you need it:

kubeconfig support the cluster option proxy-url.
I think it would be useful if function like load_kube_config would use that to set kubernetes.client.configuration.proxy

Describe the solution you'd like to see:
the changes that are need to implemented are minimal. already started with merge request #2182

@kwibus kwibus added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 22, 2024
@kwibus kwibus linked a pull request Jan 22, 2024 that will close this issue
@richardnpaul
Copy link

richardnpaul commented Jan 31, 2024

Just came across this as I was trying to use the rubusta krr plugin to k9s and I use a proxy->vpn configuration to access the clusters which are locked down to certain IP addresses. I've had to work back through the python code to this dependency to figure out that proxy-url wasn't supported to then find that there are multiple people trying to get this use case working recently.

I will say though that the associated PR is missing any kind of test coverage which means it's unlikely to be accepted.

@tianshihan818
Copy link

I tried to set the proxy as this:

from kubernetes import client, config

config.load_kube_config(DEFAULT_KUBECONFIG)
configuration = client.Configuration()
configuration.proxy = DEFAULT_PROXY
c = client.ApiClient(configuration=configuration)

And it works for the CoreV1Api methods:

client.CoreV1Api(c).list_namespaced_pod(...)

But doesn't work for:

dynamic.DynamicClient(c).resources.get(...)

Would you share any ideas? Thanks!

@kwibus
Copy link
Author

kwibus commented Feb 4, 2024

@richardnpaul merge request does now include unittest.
Did not have time until now to add them.
But i agree its better to add them

@kwibus
Copy link
Author

kwibus commented Feb 4, 2024

@tianshihan818 don`t know if this is best location to ask questions, But might be able to help you.

from kubernetes import client, config

config.load_kube_config(DEFAULT_KUBECONFIG)  # this sets Configuration._default

#  this creates a new empty Configuration not using Configuration._default
# configuration = client.Configuration()  
#  use this instead
configuration =  client.Configuration().get_default_copy()

configuration.proxy = DEFAULT_PROXY
c = client.ApiClient(configuration=configuration)

# are you sure this worked before?
client.CoreV1Api(c).list_namespaced_pod(...)

# I assume this will work now
dynamic.DynamicClient(c).resources.get(...) 

I am also new to this project, so i can be wrong.
But i hope this helps,

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants