Documentation ¶
Index ¶
- Constants
- func NewSockmapState(cgroupSubdir string) (*sockmapState, error)
- func NewXDPState(allowGenericXDP bool) (*xdpState, error)
- func NewXDPStateWithBPFLibrary(library bpf.BPFDataplane, allowGenericXDP bool) *xdpState
- type AddInterfaceFunc
- type AddInterfaceFuncs
- type AddMembersIPSetFunc
- type AddMembersIPSetFuncs
- type CbID
- type Config
- type EndpointStatusUpdateCallback
- type IfaceFlags
- type InternalDataplane
- type Manager
- type RemoveHostEndpointFunc
- type RemoveHostEndpointFuncs
- type RemoveIPSetFunc
- type RemoveIPSetFuncs
- type RemoveInterfaceFunc
- type RemoveInterfaceFuncs
- type RemoveMembersIPSetFunc
- type RemoveMembersIPSetFuncs
- type RemovePolicyDataFunc
- type RemovePolicyDataFuncs
- type RemoveWorkloadEndpointFunc
- type RemoveWorkloadEndpointFuncs
- type ReplaceIPSetFunc
- type ReplaceIPSetFuncs
- type UpdateHostEndpointFunc
- type UpdateHostEndpointFuncs
- type UpdateInterfaceFunc
- type UpdateInterfaceFuncs
- type UpdatePolicyDataFunc
- type UpdatePolicyDataFuncs
- type UpdateWorkloadEndpointFunc
- type UpdateWorkloadEndpointFuncs
Constants ¶
const (
// Interface name used by kube-proxy to bind service ips.
KubeIPVSInterface = "kube-ipvs0"
)
Variables ¶
This section is empty.
Functions ¶
func NewSockmapState ¶
func NewXDPState ¶
func NewXDPStateWithBPFLibrary ¶
func NewXDPStateWithBPFLibrary(library bpf.BPFDataplane, allowGenericXDP bool) *xdpState
Types ¶
type AddInterfaceFunc ¶
type AddInterfaceFunc func(ifaceName string, hostEPID proto.HostEndpointID)
type AddInterfaceFuncs ¶
type AddInterfaceFuncs struct {
// contains filtered or unexported fields
}
func (*AddInterfaceFuncs) Append ¶
func (fs *AddInterfaceFuncs) Append(f AddInterfaceFunc) *CbID
func (*AddInterfaceFuncs) Invoke ¶
func (fs *AddInterfaceFuncs) Invoke(ifaceName string, hostEPID proto.HostEndpointID)
type AddMembersIPSetFunc ¶
type AddMembersIPSetFuncs ¶
type AddMembersIPSetFuncs struct {
// contains filtered or unexported fields
}
func (*AddMembersIPSetFuncs) Append ¶
func (fs *AddMembersIPSetFuncs) Append(f AddMembersIPSetFunc) *CbID
type Config ¶
type Config struct { Hostname string IPv6Enabled bool RuleRendererOverride rules.RuleRenderer IPIPMTU int VXLANMTU int IgnoreLooseRPF bool MaxIPSetSize int IPSetsRefreshInterval time.Duration RouteRefreshInterval time.Duration IptablesRefreshInterval time.Duration IptablesPostWriteCheckInterval time.Duration IptablesInsertMode string IptablesLockFilePath string IptablesLockTimeout time.Duration IptablesLockProbeInterval time.Duration XDPRefreshInterval time.Duration NetlinkTimeout time.Duration RulesConfig rules.Config IfaceMonitorConfig ifacemonitor.Config StatusReportingInterval time.Duration ConfigChangedRestartCallback func() PostInSyncCallback func() HealthAggregator *health.HealthAggregator DebugSimulateDataplaneHangAfter time.Duration ExternalNodesCidrs []string XDPEnabled bool XDPAllowGeneric bool SockmapEnabled bool SockmapCgroupv2Subdir string }
type IfaceFlags ¶
type IfaceFlags uint8
type InternalDataplane ¶
type InternalDataplane struct {
// contains filtered or unexported fields
}
InternalDataplane implements an in-process Felix dataplane driver based on iptables and ipsets. It communicates with the datastore-facing part of Felix via the Send/RecvMessage methods, which operate on the protobuf-defined API objects.
Architecture ¶
The internal dataplane driver is organised around a main event loop, which handles update events from the datastore and dataplane.
Each pass around the main loop has two phases. In the first phase, updates are fanned out to "manager" objects, which calculate the changes that are needed and pass them to the dataplane programming layer. In the second phase, the dataplane layer applies the updates in a consistent sequence. The second phase is skipped until the datastore is in sync; this ensures that the first update to the dataplane applies a consistent snapshot.
Having the dataplane layer batch updates has several advantages. It is much more efficient to batch updates, since each call to iptables/ipsets has a high fixed cost. In addition, it allows for different managers to make updates without having to coordinate on their sequencing.
Requirements on the API ¶
The internal dataplane does not do consistency checks on the incoming data (as the old Python-based driver used to do). It expects to be told about dependent resources before they are needed and for their lifetime to exceed that of the resources that depend on them. For example, it is important the the datastore layer send an IP set create event before it sends a rule that references that IP set.
func NewIntDataplaneDriver ¶
func NewIntDataplaneDriver(config Config) *InternalDataplane
func (*InternalDataplane) RecvMessage ¶
func (d *InternalDataplane) RecvMessage() (interface{}, error)
func (*InternalDataplane) RegisterManager ¶
func (d *InternalDataplane) RegisterManager(mgr Manager)
func (*InternalDataplane) SendMessage ¶
func (d *InternalDataplane) SendMessage(msg interface{}) error
func (*InternalDataplane) Start ¶
func (d *InternalDataplane) Start()
type Manager ¶
type Manager interface { // OnUpdate is called for each protobuf message from the datastore. May either directly // send updates to the IPSets and iptables.Table objects (which will queue the updates // until the main loop instructs them to act) or (for efficiency) may wait until // a call to CompleteDeferredWork() to flush updates to the dataplane. OnUpdate(protoBufMsg interface{}) // Called before the main loop flushes updates to the dataplane to allow for batched // work to be completed. CompleteDeferredWork() error }
type RemoveHostEndpointFunc ¶
type RemoveHostEndpointFunc func(hostEPID proto.HostEndpointID)
type RemoveHostEndpointFuncs ¶
type RemoveHostEndpointFuncs struct {
// contains filtered or unexported fields
}
func (*RemoveHostEndpointFuncs) Append ¶
func (fs *RemoveHostEndpointFuncs) Append(f RemoveHostEndpointFunc) *CbID
func (*RemoveHostEndpointFuncs) Invoke ¶
func (fs *RemoveHostEndpointFuncs) Invoke(hostEPID proto.HostEndpointID)
type RemoveIPSetFunc ¶
type RemoveIPSetFunc func(setID string)
type RemoveIPSetFuncs ¶
type RemoveIPSetFuncs struct {
// contains filtered or unexported fields
}
func (*RemoveIPSetFuncs) Append ¶
func (fs *RemoveIPSetFuncs) Append(f RemoveIPSetFunc) *CbID
func (*RemoveIPSetFuncs) Invoke ¶
func (fs *RemoveIPSetFuncs) Invoke(setID string)
type RemoveInterfaceFunc ¶
type RemoveInterfaceFunc func(ifaceName string)
type RemoveInterfaceFuncs ¶
type RemoveInterfaceFuncs struct {
// contains filtered or unexported fields
}
func (*RemoveInterfaceFuncs) Append ¶
func (fs *RemoveInterfaceFuncs) Append(f RemoveInterfaceFunc) *CbID
func (*RemoveInterfaceFuncs) Invoke ¶
func (fs *RemoveInterfaceFuncs) Invoke(ifaceName string)
type RemoveMembersIPSetFunc ¶
type RemoveMembersIPSetFuncs ¶
type RemoveMembersIPSetFuncs struct {
// contains filtered or unexported fields
}
func (*RemoveMembersIPSetFuncs) Append ¶
func (fs *RemoveMembersIPSetFuncs) Append(f RemoveMembersIPSetFunc) *CbID
type RemovePolicyDataFunc ¶
type RemovePolicyDataFuncs ¶
type RemovePolicyDataFuncs struct {
// contains filtered or unexported fields
}
func (*RemovePolicyDataFuncs) Append ¶
func (fs *RemovePolicyDataFuncs) Append(f RemovePolicyDataFunc) *CbID
func (*RemovePolicyDataFuncs) Invoke ¶
func (fs *RemovePolicyDataFuncs) Invoke(policyID proto.PolicyID)
type RemoveWorkloadEndpointFunc ¶
type RemoveWorkloadEndpointFunc func(old *proto.WorkloadEndpoint)
type RemoveWorkloadEndpointFuncs ¶
type RemoveWorkloadEndpointFuncs struct {
// contains filtered or unexported fields
}
func (*RemoveWorkloadEndpointFuncs) Append ¶
func (fs *RemoveWorkloadEndpointFuncs) Append(f RemoveWorkloadEndpointFunc) *CbID
func (*RemoveWorkloadEndpointFuncs) Invoke ¶
func (fs *RemoveWorkloadEndpointFuncs) Invoke(old *proto.WorkloadEndpoint)
type ReplaceIPSetFunc ¶
type ReplaceIPSetFuncs ¶
type ReplaceIPSetFuncs struct {
// contains filtered or unexported fields
}
func (*ReplaceIPSetFuncs) Append ¶
func (fs *ReplaceIPSetFuncs) Append(f ReplaceIPSetFunc) *CbID
type UpdateHostEndpointFunc ¶
type UpdateHostEndpointFunc func(hostEPID proto.HostEndpointID)
type UpdateHostEndpointFuncs ¶
type UpdateHostEndpointFuncs struct {
// contains filtered or unexported fields
}
func (*UpdateHostEndpointFuncs) Append ¶
func (fs *UpdateHostEndpointFuncs) Append(f UpdateHostEndpointFunc) *CbID
func (*UpdateHostEndpointFuncs) Invoke ¶
func (fs *UpdateHostEndpointFuncs) Invoke(hostEPID proto.HostEndpointID)
type UpdateInterfaceFunc ¶
type UpdateInterfaceFunc func(ifaceName string, newHostEPID proto.HostEndpointID)
type UpdateInterfaceFuncs ¶
type UpdateInterfaceFuncs struct {
// contains filtered or unexported fields
}
func (*UpdateInterfaceFuncs) Append ¶
func (fs *UpdateInterfaceFuncs) Append(f UpdateInterfaceFunc) *CbID
func (*UpdateInterfaceFuncs) Invoke ¶
func (fs *UpdateInterfaceFuncs) Invoke(ifaceName string, newHostEPID proto.HostEndpointID)
type UpdatePolicyDataFunc ¶
type UpdatePolicyDataFuncs ¶
type UpdatePolicyDataFuncs struct {
// contains filtered or unexported fields
}
func (*UpdatePolicyDataFuncs) Append ¶
func (fs *UpdatePolicyDataFuncs) Append(f UpdatePolicyDataFunc) *CbID
type UpdateWorkloadEndpointFunc ¶
type UpdateWorkloadEndpointFunc func(old, new *proto.WorkloadEndpoint)
type UpdateWorkloadEndpointFuncs ¶
type UpdateWorkloadEndpointFuncs struct {
// contains filtered or unexported fields
}
func (*UpdateWorkloadEndpointFuncs) Append ¶
func (fs *UpdateWorkloadEndpointFuncs) Append(f UpdateWorkloadEndpointFunc) *CbID
func (*UpdateWorkloadEndpointFuncs) Invoke ¶
func (fs *UpdateWorkloadEndpointFuncs) Invoke(old, new *proto.WorkloadEndpoint)