connectivity

package
v3.29.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0, Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FLAT      = "flat"
	IPSEC     = "ipsec"
	VXLAN     = "vxlan"
	IPIP      = "ipip"
	WIREGUARD = "wireguard"
	SRv6      = "srv6"
)
View Source
const (
	AddChange    change = 0
	DeleteChange change = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectivityProvider

type ConnectivityProvider interface {
	AddConnectivity(cn *common.NodeConnectivity) error
	DelConnectivity(cn *common.NodeConnectivity) error
	// RescanState check current state in VPP and updates local cache
	RescanState()
	// Enabled checks whether the ConnectivityProvider is enabled in the config
	Enabled(cn *common.NodeConnectivity) bool
	EnableDisable(isEnable bool)
}

ConnectivityProvider configures VPP to have proper connectivity to other K8s nodes. Different implementations can connect VPP with VPP in other K8s node by using different networking technologies (VXLAN, SRv6,...).

type ConnectivityProviderData

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

func NewConnectivityProviderData

func NewConnectivityProviderData(
	vpp *vpplink.VppLink,
	server *ConnectivityServer,
	log *logrus.Entry,
) *ConnectivityProviderData

func (*ConnectivityProviderData) Clientv3

func (*ConnectivityProviderData) GetFelixConfig

func (p *ConnectivityProviderData) GetFelixConfig() *felixConfig.Config

func (*ConnectivityProviderData) GetNodeByIp

func (p *ConnectivityProviderData) GetNodeByIp(addr net.IP) *common.LocalNodeSpec

func (*ConnectivityProviderData) GetNodeIPs

func (p *ConnectivityProviderData) GetNodeIPs() (*net.IP, *net.IP)

type ConnectivityServer

type ConnectivityServer struct {
	Clientv3 calicov3cli.Interface
	// contains filtered or unexported fields
}

func NewConnectivityServer

func NewConnectivityServer(vpp *vpplink.VppLink, policyServerIpam common.PolicyServerIpam,
	clientv3 calicov3cli.Interface, log *logrus.Entry) *ConnectivityServer

func (*ConnectivityServer) ForceNodeAddition

func (s *ConnectivityServer) ForceNodeAddition(newNode common.LocalNodeSpec, newNodeIP net.IP)

ForceNodeAddition will add other node information as provided by calico configuration The usage is mainly for testing purposes.

func (*ConnectivityServer) ForceProviderEnableDisable

func (s *ConnectivityServer) ForceProviderEnableDisable(providerType string, enable bool) (err error)

ForceProviderEnableDisable force to enable/disable specific connectivity provider. The usage is mainly for testing purposes.

func (*ConnectivityServer) ForceRescanState

func (s *ConnectivityServer) ForceRescanState(providerType string) (err error)

ForceRescanState forces to rescan VPP state (ConnectivityProvider.RescanState()) for initialized ConnectivityProvider of given type. The usage is mainly for testing purposes.

func (*ConnectivityServer) ForceWGPublicKeyAddition added in v3.25.1

func (s *ConnectivityServer) ForceWGPublicKeyAddition(newNode string, wgPublicKey string)

ForceWGPublicKeyAddition will add other node information as provided by calico configuration The usage is mainly for testing purposes.

func (*ConnectivityServer) GetNodeByIp

func (s *ConnectivityServer) GetNodeByIp(addr net.IP) *common.LocalNodeSpec

func (*ConnectivityServer) GetNodeIPNet

func (s *ConnectivityServer) GetNodeIPNet(isv6 bool) *net.IPNet

func (*ConnectivityServer) GetNodeIPs

func (s *ConnectivityServer) GetNodeIPs() (ip4 *net.IP, ip6 *net.IP)

func (*ConnectivityServer) ServeConnectivity

func (s *ConnectivityServer) ServeConnectivity(t *tomb.Tomb) error

func (*ConnectivityServer) SetFelixConfig

func (s *ConnectivityServer) SetFelixConfig(felixConfig *felixConfig.Config)

func (*ConnectivityServer) SetOurBGPSpec

func (s *ConnectivityServer) SetOurBGPSpec(nodeBGPSpec *common.LocalNodeSpec)

func (*ConnectivityServer) UpdateIPConnectivity

func (s *ConnectivityServer) UpdateIPConnectivity(cn *common.NodeConnectivity, IsWithdraw bool) (err error)

func (*ConnectivityServer) UpdateSRv6Policy

func (s *ConnectivityServer) UpdateSRv6Policy(cn *common.NodeConnectivity, IsWithdraw bool) (err error)

type FlatL3Provider

type FlatL3Provider struct {
	*ConnectivityProviderData
}

func NewFlatL3Provider

func NewFlatL3Provider(d *ConnectivityProviderData) *FlatL3Provider

func (*FlatL3Provider) AddConnectivity

func (p *FlatL3Provider) AddConnectivity(cn *common.NodeConnectivity) error

func (*FlatL3Provider) DelConnectivity

func (p *FlatL3Provider) DelConnectivity(cn *common.NodeConnectivity) error

func (*FlatL3Provider) EnableDisable

func (p *FlatL3Provider) EnableDisable(isEnable bool)

func (*FlatL3Provider) Enabled

func (p *FlatL3Provider) Enabled(cn *common.NodeConnectivity) bool

func (*FlatL3Provider) RescanState

func (p *FlatL3Provider) RescanState()

type IpipProvider

type IpipProvider struct {
	*ConnectivityProviderData
	// contains filtered or unexported fields
}

func NewIPIPProvider

func NewIPIPProvider(d *ConnectivityProviderData) *IpipProvider

func (*IpipProvider) AddConnectivity

func (p *IpipProvider) AddConnectivity(cn *common.NodeConnectivity) error

func (*IpipProvider) DelConnectivity

func (p *IpipProvider) DelConnectivity(cn *common.NodeConnectivity) error

func (*IpipProvider) EnableDisable

func (p *IpipProvider) EnableDisable(isEnable bool)

func (*IpipProvider) Enabled

func (p *IpipProvider) Enabled(cn *common.NodeConnectivity) bool

func (*IpipProvider) RescanState

func (p *IpipProvider) RescanState()

type IpsecProvider

type IpsecProvider struct {
	*ConnectivityProviderData
	// contains filtered or unexported fields
}

func NewIPsecProvider

func NewIPsecProvider(d *ConnectivityProviderData, nonCryptoThreads int) *IpsecProvider

func (*IpsecProvider) AddConnectivity

func (p *IpsecProvider) AddConnectivity(cn *common.NodeConnectivity) (err error)

func (*IpsecProvider) DelConnectivity

func (p *IpsecProvider) DelConnectivity(cn *common.NodeConnectivity) (err error)

func (*IpsecProvider) EnableDisable

func (p *IpsecProvider) EnableDisable(isEnable bool)

func (*IpsecProvider) Enabled

func (p *IpsecProvider) Enabled(cn *common.NodeConnectivity) bool

func (*IpsecProvider) RescanState

func (p *IpsecProvider) RescanState()

type IpsecTunnel

type IpsecTunnel struct {
	*vpptypes.IPIPTunnel
	// contains filtered or unexported fields
}

func NewIpsecTunnel

func NewIpsecTunnel(ipipTunnel *vpptypes.IPIPTunnel) *IpsecTunnel

func (*IpsecTunnel) IsInitiator

func (tunnel *IpsecTunnel) IsInitiator() bool

func (*IpsecTunnel) Profile

func (tunnel *IpsecTunnel) Profile() string

type NodeToPolicies

type NodeToPolicies struct {
	Node       net.IP
	SRv6Tunnel []common.SRv6Tunnel
}

NodeToPolicies is data holder for node and SRv6 tunnel ending in the given node

type NodeToPrefixes

type NodeToPrefixes struct {
	Node     net.IP
	Prefixes []ip_types.Prefix
}

NodeToPrefixes is data holder for node and traffic destination prefixes (subnets) that should end in the given node

type SRv6Provider

type SRv6Provider struct {
	*ConnectivityProviderData
	// contains filtered or unexported fields
}

SRv6Provider is node connectivity provider that uses segment routing over IPv6 (SRv6) to connect the nodes For more info about SRv6, see https://datatracker.ietf.org/doc/html/rfc8986.

func NewSRv6Provider

func NewSRv6Provider(d *ConnectivityProviderData) *SRv6Provider

func (*SRv6Provider) AddConnectivity

func (p *SRv6Provider) AddConnectivity(cn *common.NodeConnectivity) (err error)

AddConnectivity creates dynamic parts of SRv6 tunnel leading to node that we are adding connectivity to. The static parts are created in RescanState. This method doesn't create the needed parts in one pass, you need to call this function 3 times. Once with basic NodeConnectivity data(from common.ConnectivityAdded event) as is done with other connectivity providers, once with data of the SRv6 tunnel(common.SRv6Tunnel) (from common.SRv6PolicyAdded event) that ends in node that we are adding connectivity to and once for create SRv6 traffic forwarding. The SRv6 tunnel info is propagated from tunnel-ending node using BGP(see bgp_watcher.go and srv6_localsid_watcher.go). After these 3 calls (and the RescanState call) you get fully configured SRv6 tunnel with SR steering, SR policy, SR localsids an SRv6 traffic forwarding.

func (*SRv6Provider) CreateSRv6Tunnnel

func (p *SRv6Provider) CreateSRv6Tunnnel(dst net.IP, prefixDst ip_types.Prefix, policyTunnel *types.SrPolicy) (err error)

func (*SRv6Provider) DelConnectivity

func (p *SRv6Provider) DelConnectivity(cn *common.NodeConnectivity) (err error)

func (*SRv6Provider) EnableDisable

func (p *SRv6Provider) EnableDisable(isEnable bool)

func (*SRv6Provider) Enabled

func (p *SRv6Provider) Enabled(cn *common.NodeConnectivity) bool

func (*SRv6Provider) GetSwifindexes

func (p *SRv6Provider) GetSwifindexes() []uint32

func (*SRv6Provider) RescanState

func (p *SRv6Provider) RescanState()

RescanState recreates(if missing in VPP) the static parts of the SRv6 tunneling on this node: 1. missing locasids (possible SRv6 tunnel endpoints) if they are not existing. 2. source encapsulation setting (pointing to IP of this node)

type VXLanProvider

type VXLanProvider struct {
	*ConnectivityProviderData
	// contains filtered or unexported fields
}

func NewVXLanProvider

func NewVXLanProvider(d *ConnectivityProviderData) *VXLanProvider

func (*VXLanProvider) AddConnectivity

func (p *VXLanProvider) AddConnectivity(cn *common.NodeConnectivity) error

func (*VXLanProvider) DelConnectivity

func (p *VXLanProvider) DelConnectivity(cn *common.NodeConnectivity) error

func (*VXLanProvider) EnableDisable

func (p *VXLanProvider) EnableDisable(isEnable bool)

func (*VXLanProvider) Enabled

func (p *VXLanProvider) Enabled(cn *common.NodeConnectivity) bool

func (*VXLanProvider) RescanState

func (p *VXLanProvider) RescanState()

type WireguardProvider

type WireguardProvider struct {
	*ConnectivityProviderData
	// contains filtered or unexported fields
}

func (*WireguardProvider) AddConnectivity

func (p *WireguardProvider) AddConnectivity(cn *common.NodeConnectivity) error

func (*WireguardProvider) DelConnectivity

func (p *WireguardProvider) DelConnectivity(cn *common.NodeConnectivity) (err error)

func (*WireguardProvider) EnableDisable

func (p *WireguardProvider) EnableDisable(isEnable bool)

func (*WireguardProvider) Enabled

func (*WireguardProvider) RescanState

func (p *WireguardProvider) RescanState()

Jump to

Keyboard shortcuts

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