k8s

package
v0.0.0-...-ec279c9 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CointainerdPidFromID

func CointainerdPidFromID(id string) (pid uint32, retErr error)

CointainerdPidFromID returns PID for container

func DockerPIDFromID

func DockerPIDFromID(id string) (pid uint32, retErr error)

DockerPIDFromID gets Docker container host PID using Docker API.

func ObserveLocal

func ObserveLocal(q chan<- [][]byte, rateLimiters []*ratelimiter.SlidingWindow, cfg *conf.Main, stop <-chan struct{}, wg *sync.WaitGroup, lg *zap.Logger, ms *metrics.Prom)

ObserveLocal is a function to observe and check for labeled pods via the local Docker service. Non-blocking. Dones wg on finish.

func ObserveViaK8sAPI

func ObserveViaK8sAPI(q chan<- [][]byte, rateLimiters []*ratelimiter.SlidingWindow, cfg *conf.Main, stop <-chan struct{}, wg *sync.WaitGroup, lg *zap.Logger, ms *metrics.Prom)

ObserveViaK8sAPI is a function to observe and check for labeled pods via k8s API server. Non-blocking. Dones wg on finish.

func OpenTCPTunnelByPID

func OpenTCPTunnelByPID(pid uint32, port uint16) (listener *net.TCPListener, returnErr error)

OpenTCPTunnelByPID opens an injected TCP port for listening in a container identified by PID.

Types

type Cont

type Cont struct {
	ID           string
	Name         string
	IsContainerd bool

	Q    chan<- [][]byte
	Cfg  *conf.Main
	Port uint16

	GlobalStop <-chan struct{} // used to stop operation globally (propagated from above)
	OwnStop    chan struct{}   // used to stop operation independently
	Wg         *sync.WaitGroup

	RateLimiters []*ratelimiter.SlidingWindow

	Lg *zap.Logger
	Ms *metrics.Prom
}

Cont represents a container.

func NewCont

func NewCont(id string, name string, isContainerd bool, q chan<- [][]byte, rateLimiters []*ratelimiter.SlidingWindow, stop <-chan struct{}, wg *sync.WaitGroup, cfg *conf.Main, lg *zap.Logger, ms *metrics.Prom) *Cont

NewCont is a constructor.

func (*Cont) StartForwarding

func (c *Cont) StartForwarding()

StartForwarding starts forwarding Graphite line data from container.

func (*Cont) StopForwarding

func (c *Cont) StopForwarding()

StopForwarding stops the forwarding.

Jump to

Keyboard shortcuts

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