Is there a method in kubernetes client replacing "kubectl port-forward" command

1/31/2019

I need to forward port of one Kubernetes pods. One possible way is to execute kubectl command like bellow:

kubectl port-forward podm-resource-manager-56b9ccd59c-8pmdn 8080

Is there a way to achieve the same using python (for example python kubernetes-client)?

-- japiasec
kubernetes

1 Answer

7/2/2019

The method connect_get_namespaced_pod_portforward is available in in the python kubernetes-client to do a port forward.

-- Jaime M.
Source: StackOverflow