dataplane

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package dataplane models Podmin's IPv6 service dataplane.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupported is returned when dataplane activation is unavailable.
	ErrUnsupported = errors.New("IPv6 service eBPF dataplane activation is unsupported")
	// ErrInvalidSnapshot is returned for an invalid complete snapshot.
	ErrInvalidSnapshot = errors.New("invalid dataplane snapshot")
)

Functions

func DeriveVIP

func DeriveVIP(cluster, namespace, name string) netip.Addr

DeriveVIP deterministically derives a VIP in fd50:6f64:6d69::/64.

Types

type Backend

type Backend struct {
	Address netip.Addr
	Port    uint16
}

Backend is a ready service endpoint.

type BackendValue

type BackendValue struct {
	Address [16]byte
	Port    uint16
}

BackendValue is the map representation of a ready endpoint.

type Port

type Port struct {
	Protocol Protocol
	Port     uint16
	Backends []Backend
}

Port describes one service transport port and its ready endpoints.

type Protocol

type Protocol uint8

Protocol is an IP transport protocol number.

const (

	// ProtocolTCP is the TCP transport protocol.
	ProtocolTCP Protocol = 6
	// ProtocolUDP is the UDP transport protocol.
	ProtocolUDP Protocol = 17
)

type Reconciler

type Reconciler struct {
	// contains filtered or unexported fields
}

Reconciler owns one unpinned dataplane lifecycle.

func New

func New(podPrefix netip.Prefix) *Reconciler

New creates an inactive dataplane reconciler.

func (*Reconciler) Close

func (r *Reconciler) Close() error

Close releases the unpinned dataplane state.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(ctx context.Context, snapshot Snapshot) error

Reconcile validates and takes ownership of a complete snapshot before platform activation.

func (*Reconciler) Tables

func (r *Reconciler) Tables() Tables

Tables returns an ownership-safe copy of the currently active map model.

func (*Reconciler) TriggerRefresh

func (r *Reconciler) TriggerRefresh()

TriggerRefresh requests asynchronous interface discovery when the dataplane is active.

type Service

type Service struct {
	VIP   netip.Addr
	Ports []Port
}

Service describes a stable IPv6 virtual service.

type ServiceKey

type ServiceKey struct {
	VIP      [16]byte
	Port     uint16
	Protocol Protocol
}

ServiceKey is the exact key installed in the service lookup map.

type ServiceValue

type ServiceValue struct {
	BackendOffset uint32
	BackendCount  uint32
}

ServiceValue identifies a contiguous range in the backend map.

type Snapshot

type Snapshot struct {
	NodeIPv6 netip.Addr
	Services []Service
}

Snapshot is the controller's complete desired dataplane state.

type Tables

type Tables struct {
	NodeIPv6 [16]byte
	Services map[ServiceKey]ServiceValue
	Backends []BackendValue
}

Tables are immutable userspace map contents ready for kernel publication.

func Compile

func Compile(snapshot Snapshot) (Tables, error)

Compile validates and converts a complete snapshot into deterministic maps.

func (Tables) SelectBackend

func (t Tables) SelectBackend(key ServiceKey, flow []byte) (BackendValue, bool)

SelectBackend deterministically selects a backend for opaque flow bytes.

Jump to

Keyboard shortcuts

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