How to implements PortForwarder in kubernetes?

11/7/2019

In source code k8s.io/kubernetes/pkg/kubelete/server/portforward , there is an Interface

// PortForwarder knows how to forward content from a data stream to/from a port in a pod.
type PortForwarder interface {
    // PortForwarder copies data between a data stream and a port in a pod.
    PortForward(name string, uid types.UID, port int32, stream io.ReadWriteCloser) error
}

How could I implement it ?

-- Mr.Sheng
kubernetes

0 Answers