intdataplane

package
v3.8.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 29 Imported by: 34

Documentation

Index

Constants

View Source
const (

	// Interface name used by kube-proxy to bind service ips.
	KubeIPVSInterface = "kube-ipvs0"
)

Variables

This section is empty.

Functions

func NewSockmapState

func NewSockmapState() (*sockmapState, error)

func NewXDPState

func NewXDPState(allowGenericXDP bool) (*xdpState, error)

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 AddMembersIPSetFunc func(setID string, members set.Set)

type AddMembersIPSetFuncs

type AddMembersIPSetFuncs struct {
	// contains filtered or unexported fields
}

func (*AddMembersIPSetFuncs) Append

func (*AddMembersIPSetFuncs) Invoke

func (fs *AddMembersIPSetFuncs) Invoke(setID string, members set.Set)

type CbID

type CbID struct {
	// contains filtered or unexported fields
}

type Config

type Config struct {
	Hostname string

	IPv6Enabled          bool
	RuleRendererOverride rules.RuleRenderer
	IPIPMTU              int
	VXLANMTU             int
	IgnoreLooseRPF       bool

	MaxIPSetSize int

	IptablesBackend                string
	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

	SidecarAccelerationEnabled bool

	LookPathOverride func(file string) (string, error)
}

type EndpointStatusUpdateCallback

type EndpointStatusUpdateCallback func(ipVersion uint8, id interface{}, status 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 (*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 (*RemoveInterfaceFuncs) Invoke

func (fs *RemoveInterfaceFuncs) Invoke(ifaceName string)

type RemoveMembersIPSetFunc

type RemoveMembersIPSetFunc func(setID string, members set.Set)

type RemoveMembersIPSetFuncs

type RemoveMembersIPSetFuncs struct {
	// contains filtered or unexported fields
}

func (*RemoveMembersIPSetFuncs) Append

func (*RemoveMembersIPSetFuncs) Invoke

func (fs *RemoveMembersIPSetFuncs) Invoke(setID string, members set.Set)

type RemovePolicyDataFunc

type RemovePolicyDataFunc func(policyID proto.PolicyID)

type RemovePolicyDataFuncs

type RemovePolicyDataFuncs struct {
	// contains filtered or unexported fields
}

func (*RemovePolicyDataFuncs) Append

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 (*RemoveWorkloadEndpointFuncs) Invoke

type ReplaceIPSetFunc

type ReplaceIPSetFunc func(setID string, members set.Set)

type ReplaceIPSetFuncs

type ReplaceIPSetFuncs struct {
	// contains filtered or unexported fields
}

func (*ReplaceIPSetFuncs) Append

func (fs *ReplaceIPSetFuncs) Append(f ReplaceIPSetFunc) *CbID

func (*ReplaceIPSetFuncs) Invoke

func (fs *ReplaceIPSetFuncs) Invoke(setID string, members set.Set)

type UpdateHostEndpointFunc

type UpdateHostEndpointFunc func(hostEPID proto.HostEndpointID)

type UpdateHostEndpointFuncs

type UpdateHostEndpointFuncs struct {
	// contains filtered or unexported fields
}

func (*UpdateHostEndpointFuncs) Append

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 (*UpdateInterfaceFuncs) Invoke

func (fs *UpdateInterfaceFuncs) Invoke(ifaceName string, newHostEPID proto.HostEndpointID)

type UpdatePolicyDataFunc

type UpdatePolicyDataFunc func(policyID proto.PolicyID, policy *proto.Policy)

type UpdatePolicyDataFuncs

type UpdatePolicyDataFuncs struct {
	// contains filtered or unexported fields
}

func (*UpdatePolicyDataFuncs) Append

func (*UpdatePolicyDataFuncs) Invoke

func (fs *UpdatePolicyDataFuncs) Invoke(policyID proto.PolicyID, policy *proto.Policy)

type UpdateWorkloadEndpointFunc

type UpdateWorkloadEndpointFunc func(old, new *proto.WorkloadEndpoint)

type UpdateWorkloadEndpointFuncs

type UpdateWorkloadEndpointFuncs struct {
	// contains filtered or unexported fields
}

func (*UpdateWorkloadEndpointFuncs) Append

func (*UpdateWorkloadEndpointFuncs) Invoke

func (fs *UpdateWorkloadEndpointFuncs) Invoke(old, new *proto.WorkloadEndpoint)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL