Documentation ¶
Overview ¶
Package wireguard implements the Wireguard tunnels to be used as vpn technology to interconnect clusters.
Index ¶
- Constants
- func NewDriver(k8sClient k8s.Interface, namespace string, config tunnel.Config) (tunnel.Driver, error)
- type ResolverFunc
- type Wireguard
- func (w *Wireguard) Close() error
- func (w *Wireguard) Collect(ch chan<- prometheus.Metric)
- func (w *Wireguard) ConnectToEndpoint(tep *netv1alpha1.TunnelEndpoint, updateStatus conncheck.UpdateFunc) (*netv1alpha1.Connection, error)
- func (w *Wireguard) DisconnectFromEndpoint(tep *netv1alpha1.TunnelEndpoint) error
- func (w *Wireguard) GetLink() netlink.Link
- func (w *Wireguard) Init() error
- func (w *Wireguard) SetNewClient() error
Constants ¶
const ( // DriverName is the name of the driver. DriverName = "wireguard" // PrivateKey is the key of private for the secret containing the wireguard keys. PrivateKey = "privateKey" // EndpointIP is the key of the endpointIP entry in back-end map. EndpointIP = "endpointIP" // AllowedIPs is the key of the allowedIPs entry in the back-end map. AllowedIPs = "allowedIPs" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ResolverFunc ¶ added in v0.3.0
ResolverFunc type of function that knows how to resolve an ip address belonging to ipv4 or ipv6 family.
type Wireguard ¶ added in v0.3.0
type Wireguard struct { metrics.Metrics Connchecker *conncheck.ConnChecker // contains filtered or unexported fields }
Wireguard a wrapper for the wireguard device and its configuration.
func (*Wireguard) Collect ¶ added in v0.6.0
func (w *Wireguard) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Wireguard) ConnectToEndpoint ¶ added in v0.3.0
func (w *Wireguard) ConnectToEndpoint(tep *netv1alpha1.TunnelEndpoint, updateStatus conncheck.UpdateFunc) (*netv1alpha1.Connection, error)
ConnectToEndpoint connects to a remote cluster described by the given tep. updateStatusCallback is a function used by conncheck to update TunnelEndpoint connected status.
func (*Wireguard) DisconnectFromEndpoint ¶ added in v0.3.0
func (w *Wireguard) DisconnectFromEndpoint(tep *netv1alpha1.TunnelEndpoint) error
DisconnectFromEndpoint disconnects a remote cluster described by the given tep.
func (*Wireguard) GetLink ¶ added in v0.3.0
GetLink returns the netlink.Link referred to the wireguard device.
func (*Wireguard) SetNewClient ¶ added in v0.3.0
SetNewClient set a new client used to interact with the wireguard device.