containerd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package containerd handles port binding events from containerd API

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExecIptablesRule  = errors.New("failed updating iptables rules")
	ErrIPAddressNotFound = errors.New("IP address not found in line")
)

Functions

This section is empty.

Types

type EventMonitor

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

EventMonitor monitors the Containerd API for container events.

func NewEventMonitor

func NewEventMonitor(
	containerdSock string,
	portTracker tracker.Tracker,
	enablePrivilegedService bool,
) (*EventMonitor, error)

NewEventMonitor creates and returns a new Event Monitor for Containerd API. Caller is responsible to make sure that Docker engine is up and running.

func (*EventMonitor) Close

func (e *EventMonitor) Close() error

Close closes the client connection to the API server.

func (*EventMonitor) IsServing

func (e *EventMonitor) IsServing(ctx context.Context) error

IsServing returns true if the client can successfully connect to the containerd daemon and the healthcheck service returns the SERVING response. This call will block if a transient error is encountered during connection. A timeout can be set in the context to ensure it returns early.

func (*EventMonitor) MonitorPorts

func (e *EventMonitor) MonitorPorts(ctx context.Context)

MonitorPorts subscribes to event API for container Create/Update/Delete events.

type Port

type Port struct {
	HostPort      int
	ContainerPort int
	Protocol      string
	HostIP        string
}

Port is representing nerdctl/ports entry in the event envelope's labels.

Jump to

Keyboard shortcuts

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