Documentation ¶
Overview ¶
portcache maintains the state about all current NodePortLocal port mappings for this Node and takes care of configuring the host accordingly.
Index ¶
- type Closeable
- type LocalPortOpener
- type NodePortData
- type PortTable
- func (pt *PortTable) AddRule(podIP string, podPort int) (int, error)
- func (pt *PortTable) CleanupAllEntries()
- func (pt *PortTable) DeleteRule(podIP string, podPort int) error
- func (pt *PortTable) GetDataForPodIP(ip string) []NodePortData
- func (pt *PortTable) GetEntry(nodeport int) *NodePortData
- func (pt *PortTable) GetEntryByPodIPPort(ip string, port int) *NodePortData
- func (pt *PortTable) RestoreRules(allNPLPorts []rules.PodNodePort, synced chan<- struct{}) error
- func (pt *PortTable) RuleExists(podIP string, podPort int) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Closeable ¶ added in v1.2.0
type Closeable interface {
Close() error
}
Using Closeable instead of net.Listener makes writing tests easier
type LocalPortOpener ¶ added in v1.2.0
type NodePortData ¶
type PortTable ¶
type PortTable struct { Table map[int]NodePortData StartPort int EndPort int PodPortRules rules.PodPortRules LocalPortOpener LocalPortOpener // contains filtered or unexported fields }
func NewPortTable ¶
func (*PortTable) CleanupAllEntries ¶
func (pt *PortTable) CleanupAllEntries()
func (*PortTable) GetDataForPodIP ¶
func (pt *PortTable) GetDataForPodIP(ip string) []NodePortData
func (*PortTable) GetEntry ¶
func (pt *PortTable) GetEntry(nodeport int) *NodePortData
func (*PortTable) GetEntryByPodIPPort ¶
func (pt *PortTable) GetEntryByPodIPPort(ip string, port int) *NodePortData
func (*PortTable) RestoreRules ¶ added in v1.2.2
func (pt *PortTable) RestoreRules(allNPLPorts []rules.PodNodePort, synced chan<- struct{}) error
RestoreRules should be called on startup to restore a set of NPL rules. It is non-blocking but takes as a parameter a channel, synced, which will be closed when the necessary rules have been restored successfully. No other operations should be performed on the PortTable until the channel is closed.
Click to show internal directories.
Click to hide internal directories.