clusternet

package
v0.0.0-...-8d377ce Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package clusternet implements a WireGuard-based overlay network for Kubernetes. It relies on controller-manager's IPAM to assign IP ranges to nodes and on Kubernetes' Node objects to distribute the Node IPs and public keys.

It sets up a single WireGuard network interface and routes the entire ClusterCIDR into that network interface, relying on WireGuard's AllowedIPs mechanism to look up the correct peer node to send the traffic to. This means that the routing table doesn't change and doesn't have to be separately managed. When clusternet is started it annotates its WireGuard public key onto its node object. For each node object that's created or updated on the K8s apiserver it checks if a public key annotation is set and if yes a peer with that public key, its InternalIP as endpoint and the CIDR for that node as AllowedIPs is created.

Can be removed once https://github.com/vishvananda/netlink/pull/464 lands

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	NodeName   string
	Kubernetes kubernetes.Interface
	Prefixes   event.Value[*oclusternet.Prefixes]
	// contains filtered or unexported fields
}

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

Run runs the ClusterNet service. See package description for what it does.

type Wireguard

type Wireguard struct {
	netlink.LinkAttrs
}

Wireguard represent links of type "wireguard", see https://www.wireguard.com/

func (*Wireguard) Attrs

func (wg *Wireguard) Attrs() *netlink.LinkAttrs

func (*Wireguard) Type

func (wg *Wireguard) Type() string

Jump to

Keyboard shortcuts

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