Documentation ¶
Overview ¶
Description: This file has the package expose.
Package expose has helpers for exposing localports ¶
Description: This file has the package expose.
Index ¶
Constants ¶
View Source
const ( ExposedPodLabel = "localizer.jaredallard.github.com/exposed" ObjectsPodLabel = "localizer.jaredallard.github.com/objects" )
Variables ¶
View Source
var ( // ErrUnderlyingTransportDied is triggered when the kubernetes port-forward loses // connection. This results in the transport protocol dying as well. ErrUnderlyingTransportDied = errors.New("underlying transport died") // ErrUnderlyingTransportProtocolDied is triggered when the ssh tunnel loses connection, // this can be due to the ssh connection being destroyed or the port-forward being killed ErrUnderlyingTransportProtocolDied = errors.New("underlying transport protocol (ssh) died") // ErrNotInitialized is used to start the initialization // process. It is not an error, despite its name. ErrNotInitialized = errors.New("not initialized") // ErrUnderlyingTransportPodDestroyed is triggered only when a pod is destroyed, // note that this will usually case ErrUnderlyingTransportDied to be triggered. ErrUnderlyingTransportPodDestroyed = errors.New("underlying transport pod died") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewExposer ¶
func NewExposer(k kubernetes.Interface, kconf *rest.Config, log logrus.FieldLogger) *Client
NewExposer returns a new client capable of exposing localports to remote locations
func (*Client) Expose ¶
func (c *Client) Expose(ctx context.Context, ports []kube.ResolvedServicePort, namespace, serviceName string) (*ServiceForward, error)
Expose exposed a port, localPort, on the local host, and opens a remote port that can be accessed via the remote service at remotePort
type ServiceForward ¶
Click to show internal directories.
Click to hide internal directories.