Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶ added in v1.27.0
type Config interface { kubectl.Config Mode() config.RunMode PortForwardResources() []*latestV1.PortForwardResource PortForwardOptions() config.PortForwardOptions }
type EntryForwarder ¶
type EntryManager ¶
type EntryManager struct {
// contains filtered or unexported fields
}
EntryManager handles forwarding entries and keeping track of forwarded ports and resources.
func NewEntryManager ¶
func NewEntryManager(entryForwarder EntryForwarder) *EntryManager
NewEntryManager returns a new port forward entry manager to keep track of forwarded ports and resources
func (*EntryManager) Start ¶ added in v1.27.0
func (b *EntryManager) Start(out io.Writer)
Start ensures the underlying entryForwarder is ready to forward.
func (*EntryManager) Stop ¶
func (b *EntryManager) Stop()
Stop terminates all kubectl port-forward commands.
func (*EntryManager) Terminate ¶
func (b *EntryManager) Terminate(p *portForwardEntry)
Terminate terminates a single port forward entry
type Forwarder ¶
type Forwarder interface { // Start initiates the forwarder's operation. It should not return until any ports have been allocated. Start(ctx context.Context, out io.Writer, namespaces []string) error Stop() }
Forwarder is an interface that can modify and manage port-forward processes
type ForwarderManager ¶
type ForwarderManager struct {
// contains filtered or unexported fields
}
ForwarderManager manages all forwarders
func NewForwarderManager ¶
func NewForwarderManager(cli *kubectl.CLI, podSelector kubernetes.PodSelector, label string, runMode config.RunMode, namespaces *[]string, options config.PortForwardOptions, userDefined []*latestV1.PortForwardResource) *ForwarderManager
NewForwarderManager returns a new port manager which handles starting and stopping port forwarding
func (*ForwarderManager) Name ¶ added in v1.26.0
func (p *ForwarderManager) Name() string
func (*ForwarderManager) Stop ¶
func (p *ForwarderManager) Stop()
type KubectlForwarder ¶
type KubectlForwarder struct {
// contains filtered or unexported fields
}
func NewKubectlForwarder ¶ added in v0.37.0
func NewKubectlForwarder(cli *kubectl.CLI) *KubectlForwarder
NewKubectlForwarder returns a new KubectlForwarder
func (*KubectlForwarder) Forward ¶
func (k *KubectlForwarder) Forward(parentCtx context.Context, pfe *portForwardEntry) error
Forward port-forwards a pod using kubectl port-forward in the background. It kills the command on errors in the kubectl port-forward log It restarts the command if it was not cancelled by skaffold It retries in case the port is taken
func (*KubectlForwarder) Start ¶ added in v1.27.0
func (k *KubectlForwarder) Start(out io.Writer)
func (*KubectlForwarder) Terminate ¶
func (*KubectlForwarder) Terminate(p *portForwardEntry)
Terminate terminates an existing kubectl port-forward command using SIGTERM
type ResourceForwarder ¶
type ResourceForwarder struct {
// contains filtered or unexported fields
}
ResourceForwarder is responsible for forwarding user defined port forwarding resources and automatically forwarding services deployed by skaffold.
func NewServicesForwarder ¶ added in v1.22.0
func NewServicesForwarder(entryManager *EntryManager, kubeContext string, label string) *ResourceForwarder
NewServicesForwarder returns a struct that tracks and port-forwards services as they are created and modified
func NewUserDefinedForwarder ¶ added in v1.22.0
func NewUserDefinedForwarder(entryManager *EntryManager, kubeContext string, userDefinedResources []*latestV1.PortForwardResource) *ResourceForwarder
NewUserDefinedForwarder returns a struct that tracks and port-forwards services as they are created and modified
func (*ResourceForwarder) Start ¶
Start gets a list of services deployed by skaffold as []latestV1.PortForwardResource and forwards them.
func (*ResourceForwarder) Stop ¶ added in v1.7.1
func (p *ResourceForwarder) Stop()
type WatchingPodForwarder ¶
type WatchingPodForwarder struct {
// contains filtered or unexported fields
}
WatchingPodForwarder is responsible for selecting pods satisfying a certain condition and port-forwarding the exposed container ports within those pods. It also tracks and manages the port-forward connections.
func NewWatchingPodForwarder ¶
func NewWatchingPodForwarder(entryManager *EntryManager, kubeContext string, podSelector kubernetes.PodSelector, containerPorts portSelector) *WatchingPodForwarder
NewWatchingPodForwarder returns a struct that tracks and port-forwards pods as they are created and modified
func (*WatchingPodForwarder) Stop ¶ added in v1.7.1
func (p *WatchingPodForwarder) Stop()