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

Example for connect_get_namespaced_pod_portforward #226

Open
mattjudge opened this issue Oct 21, 2022 · 3 comments
Open

Example for connect_get_namespaced_pod_portforward #226

mattjudge opened this issue Oct 21, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@mattjudge
Copy link

It would be extremely useful to have an example use of connect_get_namespaced_pod_portforward.

I see https://github.com/tomplus/kubernetes_asyncio/blob/master/examples/example3.py contains an example for connect_get_namespaced_pod_exec, but it's not clear how to send a port forwarded request to the pod.

@tomplus
Copy link
Owner

tomplus commented Oct 21, 2022

Unfortunately it's not supported by the library yet.

@tomplus tomplus added the enhancement New feature or request label Oct 21, 2022
@mickours
Copy link
Contributor

mickours commented Dec 6, 2024

Would be great to have a context manager for this like:

async with api.namespaced_port_forward(namespace, service, service_port, host_port):
  # do some stuff
  pass
# port forward is closed 

Any idea how to add the support for the port-froward in the library, I'd like to contribute, but I don't know where to start ?

@tomplus
Copy link
Owner

tomplus commented Dec 8, 2024

It would be fantastic. You can take a look how this is implemented in the official library: https://github.com/kubernetes-client/python/blob/master/examples/pod_portforward.py

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

No branches or pull requests

3 participants