Documentation ¶
Overview ¶
This package contains the agent code used to configure the Wireguard tunnel between nodes. The code supports adding and removing peers at run-time and the peer information is retrieved via the CiliumNode object.
Index ¶
- type Agent
- func (a *Agent) Close() error
- func (a *Agent) DeletePeer(nodeName string) error
- func (a *Agent) Init(mtuConfig mtu.Configuration) error
- func (a *Agent) OnIPIdentityCacheChange(modType ipcache.CacheModification, ipnet net.IPNet, ...)
- func (a *Agent) OnIPIdentityCacheGC()
- func (a *Agent) RestoreFinished() error
- func (a *Agent) Status(withPeers bool) (*models.WireguardStatus, error)
- func (a *Agent) UpdatePeer(nodeName, pubKeyHex string, nodeIPv4, nodeIPv6 net.IP) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
Agent needs to be initialized with Init(). In Init(), the Wireguard tunnel device will be created and the proper routes set. During Init(), existing peer keys are placed into `restoredPubKeys`. Once RestoreFinished() is called obsolete keys and peers are removed. UpdatePeer() inserts or updates the public key of peer discovered via the node manager.
func (*Agent) DeletePeer ¶
func (*Agent) Init ¶
func (a *Agent) Init(mtuConfig mtu.Configuration) error
Init creates and configures the local WireGuard tunnel device.
func (*Agent) OnIPIdentityCacheChange ¶
func (a *Agent) OnIPIdentityCacheChange(modType ipcache.CacheModification, ipnet net.IPNet, oldHostIP, newHostIP net.IP, _ *ipcache.Identity, _ ipcache.Identity, _ uint8, _ *ipcache.K8sMetadata)
OnIPIdentityCacheChange implements ipcache.IPIdentityMappingListener
func (*Agent) OnIPIdentityCacheGC ¶
func (a *Agent) OnIPIdentityCacheGC()
OnIPIdentityCacheGC implements ipcache.IPIdentityMappingListener