wireguard

package
v0.3.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package wireguard implements the Wireguard tunnels to be used as vpn technology to interconnect clusters.

Index

Constants

View Source
const (
	// PublicKey is the key of publicKey entry in back-end map and also for the secret containing the wireguard keys.
	PublicKey = "publicKey"
	// 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"
	// ListeningPort is the key of the listeningPort entry in the back-end map.
	ListeningPort = "port"
	// AllowedIPs is the key of the allowedIPs entry in the back-end map.
	AllowedIPs = "allowedIPs"
	// DeviceName name of wireguard tunnel created on the custom network namespace.
	// This tunnel is used to interconnect the local cluster with the remote ones.
	DeviceName = "liqo.tunnel"
	// DriverName  name of the driver which is also used as the type of the backend in tunnelendpoint CRD.
	DriverName = "wireguard"

	// KeysLabel label for the secret that contains the public key.
	KeysLabel = "net.liqo.io/key"
	// KeepAliveInterval interval used to send keepalive checks for the wireguard tunnels.
	KeepAliveInterval = 10 * time.Second
)

Variables

This section is empty.

Functions

func NewDriver

func NewDriver(k8sClient k8s.Interface, namespace string, config tunnel.Config) (tunnel.Driver, error)

NewDriver creates a new WireGuard driver.

Types

type ResolverFunc added in v0.3.0

type ResolverFunc func(network string, address string) (*net.IPAddr, error)

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 {
	// contains filtered or unexported fields
}

Wireguard a wrapper for the wireguard device and its configuration.

func (*Wireguard) Close added in v0.3.0

func (w *Wireguard) Close() error

Close remove the wireguard device from the host.

func (*Wireguard) ConnectToEndpoint added in v0.3.0

func (w *Wireguard) ConnectToEndpoint(tep *netv1alpha1.TunnelEndpoint) (*netv1alpha1.Connection, error)

ConnectToEndpoint connects to a remote cluster described by the given tep.

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 (w *Wireguard) GetLink() netlink.Link

GetLink returns the netlink.Link referred to the wireguard device.

func (*Wireguard) Init added in v0.3.0

func (w *Wireguard) Init() error

Init initializes the Wireguard device.

func (*Wireguard) SetNewClient added in v0.3.0

func (w *Wireguard) SetNewClient() error

SetNewClient set a new client used to interact with the wireguard device.

Jump to

Keyboard shortcuts

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