hostport

package
v0.3.15 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 4

Documentation

Index

Constants

View Source
const (
	IPv4 ipFamily = "4"
	IPv6 ipFamily = "6"
)

Constants for valid IPFamily:

Variables

This section is empty.

Functions

func NewFakeIPTables

func NewFakeIPTables() *fakeIPTables

Types

type HostPortManager

type HostPortManager interface {
	// Add implements port mappings.
	// id should be a unique identifier for a pod, e.g. podSandboxID.
	// podPortMapping is the associated port mapping information for the pod.
	// natInterfaceName is the interface that localhost uses to talk to the given pod, if known.
	Add(id string, podPortMapping *PodPortMapping, natInterfaceName string) error
	// Remove cleans up matching port mappings
	// Remove must be able to clean up port mappings without pod IP
	Remove(id string, podPortMapping *PodPortMapping) error
}

HostPortManager is an interface for adding and removing hostport for a given pod sandbox.

func NewHostportManager

func NewHostportManager(iptables utiliptables.Interface) HostPortManager

NewHostportManager creates a new HostPortManager

type PodPortMapping

type PodPortMapping struct {
	Namespace    string
	Name         string
	PortMappings []*PortMapping
	HostNetwork  bool
	IP           net.IP
}

PodPortMapping represents a pod's network state and associated container port mappings

type PortMapping

type PortMapping struct {
	HostPort      int32
	ContainerPort int32
	Protocol      config.Protocol
	HostIP        string
}

PortMapping represents a network port in a container

Jump to

Keyboard shortcuts

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