flux: github.com/weaveworks/flux/pkg/portforward Index | Files

package portforward

import "github.com/weaveworks/flux/pkg/portforward"


Package Files


type PortForward Uses

type PortForward struct {
    // The parsed Kubernetes configuration file.
    Config *rest.Config
    // The initialized Kubernetes client.
    Clientset kubernetes.Interface
    // The pod name to use, required if Labels is empty.
    Name string
    // The labels to use to find the pod.
    Labels metav1.LabelSelector
    // The port on the pod to forward traffic to.
    DestinationPort int
    // The port that the port forward should listen to, random if not set.
    ListenPort int
    // The namespace to look for the pod in.
    Namespace string
    // contains filtered or unexported fields

Used for creating a port forward into a Kubernetes pod in a Kubernetes cluster.

func NewPortForwarder Uses

func NewPortForwarder(namespace string, labels metav1.LabelSelector, port int) (*PortForward, error)

Initialize a port forwarder, loads the Kubernetes configuration file and creates the client. You do not need to use this function if you have a client to use already - the PortForward struct can be created directly.

func (*PortForward) Start Uses

func (p *PortForward) Start() error

Start a port forward to a pod - blocks until the tunnel is ready for use.

func (*PortForward) Stop Uses

func (p *PortForward) Stop()

Stop a port forward.

Package portforward imports 15 packages (graph). Updated 2020-09-10. Refresh now. Tools for package owners.