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.
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
- func NewPortForwarder(ctx context.Context, k kubernetes.Interface, r *rest.Config, ...) (chan<- PortForwardRequest, <-chan struct{}, *worker, error)
- type CreatePortForwardRequest
- type DeletePortForwardRequest
- type PodInfo
- type PortForwardConnection
- type PortForwardRequest
- type PortForwardStatus
- type Proxier
- type ProxyOpts
- type ServiceInfo
- type ServiceStatus
Constants ¶
const PodKind = "Pod"
Variables ¶
This section is empty.
Functions ¶
func NewPortForwarder ¶
func NewPortForwarder(ctx context.Context, k kubernetes.Interface, r *rest.Config, log logrus.FieldLogger, opts *ProxyOpts) (chan<- PortForwardRequest, <-chan struct{}, *worker, error)
NewPortForwarder creates a new port-forward worker that handles creating port-forwards and destroying port-forwards.
Types ¶
type CreatePortForwardRequest ¶
type CreatePortForwardRequest struct { // Service is the service this port-forward implements. Service ServiceInfo // Hostnames are the DNS entries to inject into our host's DNS // for this port-forward. This will be attached to the IP that // is created for this service. Hostnames []string // Ports are the ports this port-forward exposes Ports []string // Endpoint is the specific pod to use for this service. Endpoint *PodInfo // Recreate specifies if this should be recreated if it already // exists Recreate bool RecreateReason string }
CreatePortForwardRequest is a request to create port-forward
type DeletePortForwardRequest ¶
type DeletePortForwardRequest struct { // Service is the service that should delete being port-forwarded Service ServiceInfo }
DeletePortForwardRequest is a request to delete a port-forward
type PodInfo ¶
type PortForwardConnection ¶
type PortForwardConnection struct { Service ServiceInfo Pod PodInfo Status PortForwardStatus StatusReason string // IP that this port-forward allocates IP net.IP Hostnames []string // Ports is a local -> remote port list Ports []string // contains filtered or unexported fields }
PortForwardConnection is a port-forward that is managed by the port-forward worker.
type PortForwardRequest ¶
type PortForwardRequest struct { DeletePortForwardRequest *DeletePortForwardRequest CreatePortForwardRequest *CreatePortForwardRequest }
PortForwardRequest is a port-forward request, the non-nil struct is the type of request this is. There should only ever be one non-nil struct.
type PortForwardStatus ¶
type PortForwardStatus string
var ( PortForwardStatusRunning PortForwardStatus = "running" PortForwardStatusRecreating PortForwardStatus = "recreating" PortForwardStatusWaiting PortForwardStatus = "waiting" )
type Proxier ¶
type Proxier struct {
// contains filtered or unexported fields
}
Proxier handles creating an maintaining proxies to a remote Kubernetes service
func NewProxier ¶
func NewProxier(ctx context.Context, k kubernetes.Interface, kconf *rest.Config, log logrus.FieldLogger, opts *ProxyOpts) (*Proxier, error)
NewProxier creates a new proxier instance
type ServiceInfo ¶
type ServiceInfo struct { // Name is the name of this service Name string // Namespace is the namespace of this service Namespace string }
func (*ServiceInfo) Key ¶
func (s *ServiceInfo) Key() string
type ServiceStatus ¶
type ServiceStatus struct { ServiceInfo ServiceInfo Endpoint PodInfo // Statuses is dependent on the number of tunnels that exist for this // connection. Generally this is one, since a service is usually one // connection. Currently only one is supported, but in the future // certain services will have more than one. Statuses []PortForwardStatus // Reason is the reason that this service is in this status. // This is generally only set for services that are in a // non-running state. Reason string // IP is the IP address of this tunnel IP string // Ports are the ports this service is exposing Ports []string }