Documentation ¶
Index ¶
- func CanUseIPTablesProxier(kcompat KernelCompatTester) (bool, error)
- func CleanupLeftovers(ipt utiliptables.Interface) (encounteredError bool)
- func NewDualStackProxier(ipt [2]utiliptables.Interface, sysctl utilsysctl.Interface, ...) (proxy.Provider, error)
- type KernelCompatTester
- type LinuxKernelCompatTester
- type Proxier
- func (proxier *Proxier) OnEndpointSliceAdd(endpointSlice *discovery.EndpointSlice)
- func (proxier *Proxier) OnEndpointSliceDelete(endpointSlice *discovery.EndpointSlice)
- func (proxier *Proxier) OnEndpointSliceUpdate(_, endpointSlice *discovery.EndpointSlice)
- func (proxier *Proxier) OnEndpointSlicesSynced()
- func (proxier *Proxier) OnNodeAdd(node *v1.Node)
- func (proxier *Proxier) OnNodeDelete(node *v1.Node)
- func (proxier *Proxier) OnNodeSynced()
- func (proxier *Proxier) OnNodeUpdate(oldNode, node *v1.Node)
- func (proxier *Proxier) OnServiceAdd(service *v1.Service)
- func (proxier *Proxier) OnServiceDelete(service *v1.Service)
- func (proxier *Proxier) OnServiceSynced()
- func (proxier *Proxier) OnServiceUpdate(oldService, service *v1.Service)
- func (proxier *Proxier) Sync()
- func (proxier *Proxier) SyncLoop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanUseIPTablesProxier ¶ added in v1.4.0
func CanUseIPTablesProxier(kcompat KernelCompatTester) (bool, error)
CanUseIPTablesProxier returns true if we should use the iptables Proxier instead of the "classic" userspace Proxier.
func CleanupLeftovers ¶
func CleanupLeftovers(ipt utiliptables.Interface) (encounteredError bool)
CleanupLeftovers removes all iptables rules and chains created by the Proxier It returns true if an error was encountered. Errors are logged.
func NewDualStackProxier ¶ added in v1.18.0
func NewDualStackProxier( ipt [2]utiliptables.Interface, sysctl utilsysctl.Interface, exec utilexec.Interface, syncPeriod time.Duration, minSyncPeriod time.Duration, masqueradeAll bool, masqueradeBit int, localDetectors [2]proxyutiliptables.LocalTrafficDetector, hostname string, nodeIP [2]net.IP, recorder events.EventRecorder, healthzServer healthcheck.ProxierHealthUpdater, nodePortAddresses []string, ) (proxy.Provider, error)
NewDualStackProxier creates a MetaProxier instance, with IPv4 and IPv6 proxies.
Types ¶
type KernelCompatTester ¶ added in v1.2.0
type KernelCompatTester interface {
IsCompatible() error
}
KernelCompatTester tests whether the required kernel capabilities are present to run the iptables proxier.
type LinuxKernelCompatTester ¶ added in v1.2.0
type LinuxKernelCompatTester struct{}
LinuxKernelCompatTester is the Linux implementation of KernelCompatTester
func (LinuxKernelCompatTester) IsCompatible ¶ added in v1.2.0
func (lkct LinuxKernelCompatTester) IsCompatible() error
IsCompatible checks for the required sysctls. We don't care about the value, just that it exists. If this Proxier is chosen, we'll initialize it as we need.
type Proxier ¶
type Proxier struct {
// contains filtered or unexported fields
}
Proxier is an iptables based proxy for connections between a localhost:lport and services that provide the actual backends.
func NewProxier ¶
func NewProxier(ipt utiliptables.Interface, sysctl utilsysctl.Interface, exec utilexec.Interface, syncPeriod time.Duration, minSyncPeriod time.Duration, masqueradeAll bool, masqueradeBit int, localDetector proxyutiliptables.LocalTrafficDetector, hostname string, nodeIP net.IP, recorder events.EventRecorder, healthzServer healthcheck.ProxierHealthUpdater, nodePortAddresses []string, ) (*Proxier, error)
NewProxier returns a new Proxier given an iptables Interface instance. Because of the iptables logic, it is assumed that there is only a single Proxier active on a machine. An error will be returned if iptables fails to update or acquire the initial lock. Once a proxier is created, it will keep iptables up to date in the background and will not terminate if a particular iptables call fails.
func (*Proxier) OnEndpointSliceAdd ¶ added in v1.16.0
func (proxier *Proxier) OnEndpointSliceAdd(endpointSlice *discovery.EndpointSlice)
OnEndpointSliceAdd is called whenever creation of a new endpoint slice object is observed.
func (*Proxier) OnEndpointSliceDelete ¶ added in v1.16.0
func (proxier *Proxier) OnEndpointSliceDelete(endpointSlice *discovery.EndpointSlice)
OnEndpointSliceDelete is called whenever deletion of an existing endpoint slice object is observed.
func (*Proxier) OnEndpointSliceUpdate ¶ added in v1.16.0
func (proxier *Proxier) OnEndpointSliceUpdate(_, endpointSlice *discovery.EndpointSlice)
OnEndpointSliceUpdate is called whenever modification of an existing endpoint slice object is observed.
func (*Proxier) OnEndpointSlicesSynced ¶ added in v1.16.0
func (proxier *Proxier) OnEndpointSlicesSynced()
OnEndpointSlicesSynced is called once all the initial event handlers were called and the state is fully propagated to local cache.
func (*Proxier) OnNodeAdd ¶ added in v1.17.0
OnNodeAdd is called whenever creation of new node object is observed.
func (*Proxier) OnNodeDelete ¶ added in v1.17.0
OnNodeDelete is called whenever deletion of an existing node object is observed.
func (*Proxier) OnNodeSynced ¶ added in v1.17.0
func (proxier *Proxier) OnNodeSynced()
OnNodeSynced is called once all the initial event handlers were called and the state is fully propagated to local cache.
func (*Proxier) OnNodeUpdate ¶ added in v1.17.0
OnNodeUpdate is called whenever modification of an existing node object is observed.
func (*Proxier) OnServiceAdd ¶ added in v1.7.0
OnServiceAdd is called whenever creation of new service object is observed.
func (*Proxier) OnServiceDelete ¶ added in v1.7.0
OnServiceDelete is called whenever deletion of an existing service object is observed.
func (*Proxier) OnServiceSynced ¶ added in v1.7.0
func (proxier *Proxier) OnServiceSynced()
OnServiceSynced is called once all the initial event handlers were called and the state is fully propagated to local cache.
func (*Proxier) OnServiceUpdate ¶
OnServiceUpdate is called whenever modification of an existing service object is observed.