k8stun

package module
v0.0.0-...-5083ea1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

README

k8stun

Managed k8s port-forwarding

Installation

go install github.com/petnet/k8stun/cmd/k8stun@latest

Usage

k8stun -config config.yaml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Tunnels []Tunnel `yaml:"tunnels"`
}

func LoadConfig

func LoadConfig(configFile string) (Config, error)

LoadConfig ...

type Logger

type Logger struct {
	Label string
	// contains filtered or unexported fields
}

Logger implements formatted logging for tunnels via io.Writer

func (*Logger) Printf

func (tl *Logger) Printf(format string, a ...interface{})

Printf provides string formatted logging

func (*Logger) Write

func (tl *Logger) Write(out []byte) (int, error)

Write implements io.Writer

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service ...

func NewService

func NewService(config *rest.Config, tunnels []Tunnel) *Service

NewService ...

func (*Service) Start

func (s *Service) Start()

Start all tunnels

func (*Service) Stop

func (s *Service) Stop()

Stop all tunnels

type Tunnel

type Tunnel struct {
	Name          string `yaml:"name"`
	Namespace     string `yaml:"namespace"`
	LabelSelector string `yaml:"labelSelector"`
	ListenPort    int    `yaml:"listenPort"`
	TargetPort    int    `yaml:"targetPort"`
	// contains filtered or unexported fields
}

Tunnel manages one portforward instance

func (Tunnel) Initialize

func (tun Tunnel) Initialize(id int, wg *sync.WaitGroup, config *rest.Config) *Tunnel

Initialize ...

func (*Tunnel) NextBackOff

func (tun *Tunnel) NextBackOff() time.Duration

NextBackOff implements backoff.Backoff interface

func (*Tunnel) Reset

func (tun *Tunnel) Reset()

Reset implements backoff.Backoff interface

func (*Tunnel) Start

func (tun *Tunnel) Start()

Start ...

func (*Tunnel) Stop

func (tun *Tunnel) Stop()

Stop ...

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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