kubernetesk8s.io/kubernetes/pkg/proxy/util Index | Files

package util

import "k8s.io/kubernetes/pkg/proxy/util"

Index

Functions

func ClearUDPConntrackForIP

func ClearUDPConntrackForIP(execer exec.Interface, ip string) error

DeleteServiceConnections uses the conntrack tool to delete the conntrack entries for the UDP connections specified by the given service IP

func ClearUDPConntrackForPeers

func ClearUDPConntrackForPeers(execer exec.Interface, origin, dest string) error

ClearUDPConntrackForPeers uses the conntrack tool to delete the conntrack entries for the UDP connections specified by the {origin, dest} IP pair.

func ClearUDPConntrackForPort

func ClearUDPConntrackForPort(execer exec.Interface, port int) error

ClearUDPConntrackForPort uses the conntrack tool to delete the conntrack entries for the UDP connections specified by the port. When a packet arrives, it will not go through NAT table again, because it is not "the first" packet. The solution is clearing the conntrack. Known issues: https://github.com/docker/docker/issues/8795 https://github.com/kubernetes/kubernetes/issues/31983

func ExecConntrackTool

func ExecConntrackTool(execer exec.Interface, parameters ...string) error

ExecConntrackTool executes the conntrack tool using the given parameters

func IsLocalIP

func IsLocalIP(ip string) (bool, error)

func RevertPorts

func RevertPorts(replacementPortsMap, originalPortsMap map[LocalPort]Closeable)

RevertPorts is closing ports in replacementPortsMap but not in originalPortsMap. In other words, it only closes the ports opened in this sync.

func ShouldSkipService

func ShouldSkipService(svcName types.NamespacedName, service *api.Service) bool

Types

type Closeable

type Closeable interface {
	Close() error
}

Closeable is an interface around closing an port.

type LocalPort

type LocalPort struct {
	// Description is the identity message of a given local port.
	Description string
	// IP is the IP address part of a given local port.
	// If this string is empty, the port binds to all local IP addresses.
	IP string
	// Port is the port part of a given local port.
	Port int
	// Protocol is the protocol part of a given local port.
	// The value is assumed to be lower-case. For example, "udp" not "UDP", "tcp" not "TCP".
	Protocol string
}

LocalPort describes a port on specific IP address and protocol

func (*LocalPort) String

func (lp *LocalPort) String() string

type PortOpener

type PortOpener interface {
	OpenLocalPort(lp *LocalPort) (Closeable, error)
}

PortOpener is an interface around port opening/closing. Abstracted out for testing.

Source Files

conntrack.go port.go utils.go

Version
v1.8.5-beta.0
Published
Nov 20, 2017
Platform
js/wasm
Imports
9 packages
Last checked
7 minutes ago

Tools for package owners.