package nftables
import "k8s.io/kubernetes/pkg/proxy/nftables"
Index ¶
- func CleanupLeftovers(ctx context.Context) bool
- func NewDualStackProxier( ctx context.Context, syncPeriod time.Duration, minSyncPeriod time.Duration, masqueradeAll bool, masqueradeBit int, localDetectors map[v1.IPFamily]proxyutil.LocalTrafficDetector, nodeName string, nodeIPs map[v1.IPFamily]net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxyHealthServer, nodePortAddresses []string, initOnly bool, ) (proxy.Provider, error)
- type Proxier
- func NewProxier(ctx context.Context, ipFamily v1.IPFamily, syncPeriod time.Duration, minSyncPeriod time.Duration, masqueradeAll bool, masqueradeBit int, localDetector proxyutil.LocalTrafficDetector, nodeName string, nodeIP net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxyHealthServer, nodePortAddressStrings []string, initOnly bool, ) (*Proxier, error)
- 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) OnServiceAdd(service *v1.Service)
- func (proxier *Proxier) OnServiceCIDRsChanged(cidrs []string)
- func (proxier *Proxier) OnServiceDelete(service *v1.Service)
- func (proxier *Proxier) OnServiceSynced()
- func (proxier *Proxier) OnServiceUpdate(oldService, service *v1.Service)
- func (proxier *Proxier) OnTopologyChange(topologyLabels map[string]string)
- func (proxier *Proxier) Sync()
- func (proxier *Proxier) SyncLoop()
Functions ¶
func CleanupLeftovers ¶
CleanupLeftovers removes all nftables rules and chains created by the Proxier It returns true if an error was encountered. Errors are logged.
func NewDualStackProxier ¶
func NewDualStackProxier( ctx context.Context, syncPeriod time.Duration, minSyncPeriod time.Duration, masqueradeAll bool, masqueradeBit int, localDetectors map[v1.IPFamily]proxyutil.LocalTrafficDetector, nodeName string, nodeIPs map[v1.IPFamily]net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxyHealthServer, nodePortAddresses []string, initOnly bool, ) (proxy.Provider, error)
NewDualStackProxier creates a MetaProxier instance, with IPv4 and IPv6 proxies.
Types ¶
type Proxier ¶
type Proxier struct {
// contains filtered or unexported fields
}
Proxier is an nftables-based proxy
func NewProxier ¶
func NewProxier(ctx context.Context, ipFamily v1.IPFamily, syncPeriod time.Duration, minSyncPeriod time.Duration, masqueradeAll bool, masqueradeBit int, localDetector proxyutil.LocalTrafficDetector, nodeName string, nodeIP net.IP, recorder events.EventRecorder, healthzServer *healthcheck.ProxyHealthServer, nodePortAddressStrings []string, initOnly bool, ) (*Proxier, error)
NewProxier returns a new single-stack NFTables proxier.
func (*Proxier) OnEndpointSliceAdd ¶
func (proxier *Proxier) OnEndpointSliceAdd(endpointSlice *discovery.EndpointSlice)
OnEndpointSliceAdd is called whenever creation of a new endpoint slice object is observed.
func (*Proxier) OnEndpointSliceDelete ¶
func (proxier *Proxier) OnEndpointSliceDelete(endpointSlice *discovery.EndpointSlice)
OnEndpointSliceDelete is called whenever deletion of an existing endpoint slice object is observed.
func (*Proxier) OnEndpointSliceUpdate ¶
func (proxier *Proxier) OnEndpointSliceUpdate(_, endpointSlice *discovery.EndpointSlice)
OnEndpointSliceUpdate is called whenever modification of an existing endpoint slice object is observed.
func (*Proxier) OnEndpointSlicesSynced ¶
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) OnServiceAdd ¶
OnServiceAdd is called whenever creation of new service object is observed.
func (*Proxier) OnServiceCIDRsChanged ¶
OnServiceCIDRsChanged is called whenever a change is observed in any of the ServiceCIDRs, and provides complete list of service cidrs.
func (*Proxier) OnServiceDelete ¶
OnServiceDelete is called whenever deletion of an existing service object is observed.
func (*Proxier) OnServiceSynced ¶
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.
func (*Proxier) OnTopologyChange ¶
OnTopologyChange is called whenever this node's proxy relevant topology-related labels change.
func (*Proxier) Sync ¶
func (proxier *Proxier) Sync()
Sync is called to synchronize the proxier state to nftables as soon as possible.
func (*Proxier) SyncLoop ¶
func (proxier *Proxier) SyncLoop()
SyncLoop runs periodic work. This is expected to run as a goroutine or as the main loop of the app. It does not return.
Source Files ¶
doc.go proxier.go
- Version
- v1.34.0-rc.0
- Published
- Aug 6, 2025
- Platform
- linux/amd64
- Imports
- 32 packages
- Last checked
- 3 minutes ago –
Tools for package owners.