Documentation
¶
Overview ¶
Package clusternet implements a Cluster Networking mesh service running on all Metropolis nodes.
The mesh is based on wireguard and a centralized configuration store in the cluster Curator (in etcd).
While the implementation is nearly generic, it currently makes an assumption that it is used only for Kubernetes pod networking. That has a few implications:
First, we only have a single real route on the host into the wireguard networking mesh / interface, and that is configured ahead of time in the Service as ClusterNet. All destination addresses that should be carried by the mesh must thus be part of this single route. Otherwise, traffic will be able to flow into the node from other nodes, but will exit through another interface. This is used in practice to allow other host nodes (whose external addresses are outside the cluster network) to access the cluster network.
Second, we have two hardcoded/purpose-specific sources of prefixes:
- Pod networking node prefixes from the kubelet
- The host's external IP address (as a /32) from the network service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Prefixes ¶
Prefixes are network prefixes that should be announced by a node to the Cluster Networking mesh.
type Service ¶
type Service struct { // Curator is the gRPC client that the service will use to reach the cluster's // Curator, for pushing locally announced prefixes and pulling information about // other nodes. Curator apb.CuratorClient // ClusterNet is the prefix that will be programmed to exit through the wireguard // mesh. ClusterNet net.IPNet // DataDirectory is where the WireGuard key of this node will be stored. DataDirectory *localstorage.DataKubernetesClusterNetworkingDirectory // LocalKubernetesPodNetwork is an event.Value watched for prefixes that should // be announced into the mesh. This is to be Set by the Kubernetes service once // it knows about the local node's IPAM address assignment. LocalKubernetesPodNetwork event.Value[*Prefixes] // Network service used to get the local node's IP address to submit it as a /32. Network event.Value[*network.Status] // contains filtered or unexported fields }
Service implements the Cluster Networking Mesh. See package-level docs for more details.