Giving the port forward object
from kubernetes.stream import stream, portforward
pf = portforward(
k8s_client_v1.connect_get_namespaced_pod_portforward,
pod_name,
name_space,
ports=port
)
pf.socket(port)
pf is a socket object from AF_UNIX family.
I need a better understating whether another AF_INET family socket has to be instantiated in oder to achieve the same functionality as kubectl client has, ex: kubectl port-forward $pod_name $port
I appreciate in advance if someone could share any snippets of this type of implementation.
At this moment creating port forward object was inspired from here