portforward

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForwardPod

func ForwardPod(ctx context.Context, cfg *rest.Config, pod *corev1obj.Pod, ports []uint16, fn func(ctx context.Context, m Map) error) (err error)

ForwardPod connects to the given pod on an HTTP-accessible Kubernetes instance, exposing the specified remote TCP ports on the pod locally.

It invokes the given callback function with a map of the remote port number to the allocated local port number. When the callback completes, the connection is torn down.

func ForwardService

func ForwardService(ctx context.Context, cfg *rest.Config, svc *corev1obj.Service, port uint16, fn func(ctx context.Context, port uint16) error) error

ForwardService forwards a single port from a given service on an HTTP-accessible Kubernetes instance. It always picks the first pod that serves as an endpoint for that service and port combination, and otherwise behaves like ForwardPod.

Types

type Map

type Map map[uint16]uint16

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL