Documentation
¶
Overview ¶
Package connector is responsible for the datapath specific plumbing to connect an endpoint to the network
Index ¶
- Constants
- Variables
- func CniAltName(ifName string) string
- func DeleteLinkPair(cfg LinkConfig) error
- func DisableRpFilter(sysctl sysctl.Sysctl, ifName string) error
- func Endpoint2IfName(endpointID string) string
- func Endpoint2TempIfName(endpointID string) string
- func IPv4Gateway(addr *models.NodeAddressing) string
- func IPv4Routes(addr *models.NodeAddressing, linkMTU int) ([]route.Route, error)
- func IPv6Gateway(addr *models.NodeAddressing) string
- func IPv6Routes(addr *models.NodeAddressing, linkMTU int) ([]route.Route, error)
- func IsCiliumManagedLink(link netlink.Link) bool
- func NewLinkPair(log *slog.Logger, mode Mode, cfg LinkConfig, sysctl sysctl.Sysctl) (*linkPair, error)
- func SufficientAddressing(addr *models.NodeAddressing) error
- type Config
- type LinkConfig
- type LinkPair
- type Mode
Constants ¶
const ( ModeUnspec = Mode("") ModeAuto = Mode(dpoption.DatapathModeAuto) ModeVeth = Mode(dpoption.DatapathModeVeth) ModeNetkit = Mode(dpoption.DatapathModeNetkit) ModeNetkitL2 = Mode(dpoption.DatapathModeNetkitL2) )
const (
// ContainerInterfacePrefix is the container's internal interface name prefix.
ContainerInterfacePrefix = "cilium"
)
const (
// HostInterfacePrefix is the Host interface prefix.
HostInterfacePrefix = "lxc"
)
Variables ¶
var Cell = cell.Module( "connector", "Datapath connector configuration mutator", cell.Provide(newConnectorConfig), )
Functions ¶
func CniAltName ¶ added in v1.18.11
CniAltName returns the altname for this `ifName`
func DeleteLinkPair ¶ added in v1.20.0
func DeleteLinkPair(cfg LinkConfig) error
func DisableRpFilter ¶
DisableRpFilter tries to disable rpfilter on specified interface
func Endpoint2IfName ¶
Endpoint2IfName returns the host interface name for the given endpointID.
func Endpoint2TempIfName ¶
Endpoint2TempIfName returns the temporary interface name for the given endpointID.
func IPv4Gateway ¶
func IPv4Gateway(addr *models.NodeAddressing) string
IPv4Gateway returns the IPv4 gateway address for endpoints.
func IPv4Routes ¶
IPv4Routes returns IPv4 routes to be installed in endpoint's networking namespace.
func IPv6Gateway ¶
func IPv6Gateway(addr *models.NodeAddressing) string
IPv6Gateway returns the IPv6 gateway address for endpoints.
func IPv6Routes ¶
IPv6Routes returns IPv6 routes to be installed in endpoint's networking namespace.
func IsCiliumManagedLink ¶ added in v1.18.11
IsCiliumManagedLink returns true if the link was created by Cilium, identified by the presence of the CniAltName(ifname) altname attribute.
func NewLinkPair ¶ added in v1.20.0
func SufficientAddressing ¶
func SufficientAddressing(addr *models.NodeAddressing) error
SufficientAddressing returns an error if the provided NodeAddressing does not provide sufficient information to derive all IPAM required settings.
Types ¶
type LinkConfig ¶ added in v1.18.0
type LinkConfig struct {
// EndpointID defines the container ID to which we are creating a new
// linkpair. Set this if you want the connector to generate interface
// names itself. Otherwise, set HostIfName and PeerIfName.
EndpointID string
// HostIfName defines the interface name as seen in the host namespace.
HostIfName string
// PeerIfName defines the interface name as seen in the container namespace.
PeerIfName string
// PeerNamespace defines the namespace the peer link should be moved into.
PeerNamespace *netns.NetNS
GROIPv6MaxSize int
GSOIPv6MaxSize int
GROIPv4MaxSize int
GSOIPv4MaxSize int
DeviceMTU int
DeviceHeadroom uint16
DeviceTailroom uint16
}
LinkConfig contains the GRO/GSO, MTU values and buffer margins to be configured on both sides of the created veth or netkit pair.