Documentation ¶
Overview ¶
Copyright 2020 Jared Allard
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 Jared Allard ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( ExposedPodLabel = "localizer.jaredallard.github.com/exposed" ObjectsPodLabel = "localizer.jaredallard.github.com/objects" )
Variables ¶
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