vpc

package
v0.1.0-latest-stable Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 1 * time.Minute
	LongTimeout    = 6 * time.Minute
)

Variables

This section is empty.

Functions

func CleanupHosts

func CleanupHosts(overlays []WorkerOverlayIPs, pfIfaces []string)

CleanupHosts flushes PF overlays using each host's Subnet and removes containers.

func CreateDHCPNetworkAttachmentDefinition

func CreateDHCPNetworkAttachmentDefinition(ctx context.Context, testClient client.Client, namespace, nadName, hostDevice string, mtu int, labels map[string]string)

CreateDHCPNetworkAttachmentDefinition creates a NAD using the host-device CNI plugin with DHCP IPAM and a tuning plugin for MTU configuration. Works for both VFs and PFs.

func CreateTestNamespace

func CreateTestNamespace(ctx context.Context, testClient client.Client, namespace string, labels map[string]string)

func DeployDHCPDaemon

func DeployDHCPDaemon(ctx context.Context, testClient client.Client, ds *appsv1.DaemonSet, cleanupLabels map[string]string) *appsv1.DaemonSet

DeployDHCPDaemon creates the host-side CNI DHCP DaemonSet from the given spec (typically from applyVPCOVNConfig / applyVPCOVSConfig). The DHCP daemon creates /run/cni/dhcp.sock on each node, which the DHCP CNI IPAM plugin uses to obtain overlay IPs from the DPU's DHCP agent. cleanupLabels are merged into the DaemonSet and pod template so named-scope cleanup can delete the workload (see cleanup.Tracker.executeCleanup label selector).

func GetPodIPAddressFromNetworkStatus

func GetPodIPAddressFromNetworkStatus(ctx context.Context, testClient client.Client, namespace, podName string, interfaceName string) string

GetPodIPAddressFromNetworkStatus returns the IP address of a pod from the network status with the given interface name.

func GetPodsMatchingLabels

func GetPodsMatchingLabels(ctx context.Context, testclient client.Client, namespace string, matchingLabels map[string]string) []corev1.Pod

GetPodsMatchingLabels gets the pods matching the given labels.

func SetLinkMacAddress

func SetLinkMacAddress(hostIP net.IP, interfaceName, macAddress string)

SetLinkMacAddress sets the MAC address on a link via SSH to the host (idempotent).

func UpdateDPUNodeLabelsMerge

func UpdateDPUNodeLabelsMerge(ctx context.Context, c client.Client, nodeName string, toSet map[string]string, toDelete []string)

UpdateDPUNodeLabelsMerge adds/updates labels from toSet and deletes labels in toDelete.

func VerifyAttachmentsDHCPAddresses

func VerifyAttachmentsDHCPAddresses(links []remotehost.VRFLink, overlays []WorkerOverlayIPs)

VerifyAttachmentsDHCPAddresses asserts each host got the expected CIDR per VRF link.

func VerifyAttachmentsDHCPRoutes

func VerifyAttachmentsDHCPRoutes(links []remotehost.VRFLink, overlays []WorkerOverlayIPs, bits UnderlayPrefixBits)

VerifyAttachmentsDHCPRoutes asserts DHCP software-plane and rail prefixes in each VRF table.

func WaitForDHCPDaemonReady

func WaitForDHCPDaemonReady(ctx context.Context, testClient client.Client, ds *appsv1.DaemonSet)

WaitForDHCPDaemonReady waits until the DHCP DaemonSet has all pods ready.

Types

type UnderlayPrefixBits

type UnderlayPrefixBits struct {
	// Overlay is overlayNetworkPrefixLength.
	Overlay int
	// SoftwarePlane is softwarePlaneIDBitLength.
	SoftwarePlane int
	// Rail is railIDBitLength.
	Rail int
}

UnderlayPrefixBits is overlay, software-plane, and rail prefix lengths from underlayConfigMapData.

type WorkerOverlayIPs

type WorkerOverlayIPs struct {
	// Worker is the remote host.
	Worker remotehost.Host
	// IPs are expected CIDRs, one per VRF link (e.g. 10.0.0.1/31).
	IPs []string
	// Subnet is the overlay subnet used for route flush.
	Subnet string
	// Family is IPv4 or IPv6, zero value is IPv4.
	Family remotehost.IPFamily
}

WorkerOverlayIPs are expected overlay addresses and subnet for a host.

Directories

Path Synopsis
Package topology describes per-hardware Weave rail layout used by e2e tests.
Package topology describes per-hardware Weave rail layout used by e2e tests.
bf3
Package bf3 holds Weave e2e topology for BlueField-3 lab hardware.
Package bf3 holds Weave e2e topology for BlueField-3 lab hardware.
bf4
Package bf4 holds Weave e2e topology and lab wiring for BlueField-4.
Package bf4 holds Weave e2e topology and lab wiring for BlueField-4.

Jump to

Keyboard shortcuts

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