Documentation
¶
Index ¶
- Constants
- Variables
- func AddrsFrom(prefixes ...netip.Prefix) iter.Seq[netip.Prefix]
- func AirGenerate(ctx context.Context, workDir, cacheDir string, hMode HydrateMode) error
- func Build(ctx context.Context, workDir, cacheDir string, extraCacheDirs []string, ...) error
- func CheckStaleVMs(ctx context.Context, kill bool) ([]int32, error)
- func CollectN[E any](n int, seq iter.Seq[E]) []E
- func CollectServerEndpoints(ctx context.Context, kube kclient.Client, ssh SSHResolver, servers []string) ([]*Endpoint, []DroppedEndpoint, error)
- func CreateOrUpdateVpc(ctx context.Context, kube kclient.Client, vpc *vpcapi.VPC) (bool, error)
- func Diagram(ctx context.Context, workDir, cacheDir string, live bool, ...) error
- func DoSetupPeerings(ctx context.Context, kube kclient.Client, ...) error
- func DoShowTech(ctx context.Context, workDir, cacheDir string) error
- func DoSwitchPower(ctx context.Context, workDir, cacheDir string, opts SwitchPowerOpts) error
- func DoSwitchReinstall(ctx context.Context, workDir, cacheDir string, opts SwitchReinstallOpts) error
- func DoVLABBenchAgents(ctx context.Context, workDir, cacheDir string, opts BenchAgentsOpts) error
- func DoVLABBenchBoots(ctx context.Context, workDir, cacheDir string, opts BenchBootsOpts) error
- func DoVLABBenchClean(ctx context.Context, workDir, cacheDir string, opts BenchCleanOpts) error
- func DoVLABBenchDHCP(ctx context.Context, workDir, cacheDir string, opts BenchDHCPOpts) error
- func DoVLABBenchHealth(ctx context.Context, workDir, cacheDir string, opts BenchHealthOpts) error
- func DoVLABBenchInit(ctx context.Context, workDir, cacheDir string, opts BenchInitOpts) error
- func DoVLABBenchSample(ctx context.Context, workDir, cacheDir string, opts BenchSampleOpts) error
- func DoVLABBenchUsers(ctx context.Context, workDir, cacheDir string, opts BenchUsersOpts) error
- func DoVLABInspect(ctx context.Context, workDir, cacheDir string, opts InspectOpts) error
- func DoVLABInspectPods(ctx context.Context, workDir, cacheDir string, opts InspectPodsOpts) error
- func DoVLABReleaseTest(ctx context.Context, workDir, cacheDir string, opts ReleaseTestOpts) error
- func DoVLABSCP(ctx context.Context, workDir, cacheDir, name, username string, args []string) error
- func DoVLABSSH(ctx context.Context, workDir, cacheDir, name, username string, args []string) error
- func DoVLABSerial(ctx context.Context, workDir, cacheDir, name string, args []string) error
- func DoVLABSerialLog(ctx context.Context, workDir, cacheDir, name string, args []string) error
- func DoVLABSetupPeerings(ctx context.Context, workDir, cacheDir string, opts SetupPeeringsOpts) error
- func DoVLABSetupVPCs(ctx context.Context, workDir, cacheDir string, opts SetupVPCsOpts) ([]*Endpoint, []DroppedEndpoint, error)
- func DoVLABTestConnectivity(ctx context.Context, workDir, cacheDir string, opts TestConnectivityOpts) error
- func DoVLABTestConnectivityWithMatrix(ctx context.Context, workDir, cacheDir string, opts TestConnectivityOpts, ...) error
- func DoVLABWait(ctx context.Context, workDir, cacheDir string) error
- func GetServerNetconfCmd(conn *wiringapi.Connection, opts ServerNetconfOpts) (string, error)
- func Init(ctx context.Context, c InitConfig) error
- func IsSameEndpointNode(a, b *Endpoint) bool
- func LoadTemplateValues(valuesFiles, sets []string) (map[string]any, error)
- func OverlayMatrixNAT(matrix *ConnectivityMatrix, srcPred, dstPred EndpointPredicate, ...) error
- func Precache(ctx context.Context, workDir, cacheDir string, extraCacheDirs []string, ...) error
- func PrecacheVLABOCI(cfg fabapi.Fabricator) (comp.OCIArtifacts, error)
- func PrecacheVLABORAS(cfg fabapi.Fabricator) (comp.OCIArtifacts, error)
- func PreparePassthrough(ctx context.Context, devs []string) error
- func ReleaseTest(ctx context.Context, c *Config, vlab *VLAB, opts ReleaseTestOpts) error
- func ResolveDefaultServerMTU(ctx context.Context, kube kclient.Client, opts *SetupVPCsOpts) error
- func RunReleaseTestSuites(ctx context.Context, vlabCfg *Config, vlab *VLAB, rtOpts ReleaseTestOpts) error
- func SetupVLABNet(_ context.Context, nets []VLABNet) error
- func SubPrefixesFrom(bits int, prefixes ...netip.Prefix) iter.Seq[netip.Prefix]
- func VLABGenerate(ctx context.Context, workDir, cacheDir string, builder VLABBuilder, ...) error
- func VLABUp(ctx context.Context, workDir, cacheDir string, extraCacheDirs []string, ...) error
- func VLANsFrom(ranges ...meta.VLANRange) iter.Seq[uint16]
- func Validate(ctx context.Context, workDir, cacheDir string, hMode HydrateMode) error
- func Versions(ctx context.Context, workDir, cacheDir string, hMode HydrateMode) error
- func WaitReady(ctx context.Context, kube kclient.Reader, opts WaitReadyOpts) error
- type AirServersIn
- type AirServersInServer
- type AirServersInServerIface
- type AirServersInServerRoute
- type AirTopoIn
- type AirTopoLink
- type AirTopoLinkEndpoint
- type AirTopoNode
- type AttachedServerInfo
- type BenchAgentsOpts
- type BenchBootsOpts
- type BenchCleanOpts
- type BenchDHCPOpts
- type BenchHealthOpts
- type BenchInitOpts
- type BenchSampleOpts
- type BenchUsersOpts
- type BuildOpts
- type Config
- func (c *Config) AirGenerate(ctx context.Context) error
- func (c *Config) CollectVLABDebug(ctx context.Context, vlab *VLAB, opts VLABRunOpts, forceShowTech bool)
- func (c *Config) Inspect(ctx context.Context, vlab *VLAB, opts InspectOpts) error
- func (c *Config) InspectPods(ctx context.Context, opts InspectPodsOpts) error
- func (c *Config) PrepareVLAB(ctx context.Context, opts VLABUpOpts) (*VLAB, error)
- func (c *Config) SSH(ctx context.Context, vlab *VLAB, target string) (*sshutil.Config, error)
- func (c *Config) SSHVM(ctx context.Context, vlab *VLAB, vm VM) (*sshutil.Config, error)
- func (c *Config) SetupPeerings(ctx context.Context, vlab *VLAB, opts SetupPeeringsOpts) error
- func (c *Config) SetupVPCs(ctx context.Context, vlab *VLAB, opts SetupVPCsOpts) ([]*Endpoint, []DroppedEndpoint, error)
- func (c *Config) TestConnectivity(ctx context.Context, vlab *VLAB, opts TestConnectivityOpts) error
- func (c *Config) TestConnectivityWithMatrix(ctx context.Context, vlab *VLAB, opts TestConnectivityOpts, ...) error
- func (c *Config) VLABAccess(ctx context.Context, vlab *VLAB, t VLABAccessType, name, username string, ...) error
- func (c *Config) VLABRun(ctx context.Context, vlab *VLAB, opts VLABRunOpts) error
- func (c *Config) VLABShowTech(ctx context.Context, vlab *VLAB, opts ShowTechOpts) error
- func (c *Config) VLABSwitchPower(ctx context.Context, opts SwitchPowerOpts) error
- func (c *Config) VLABSwitchReinstall(ctx context.Context, opts SwitchReinstallOpts) error
- func (c *Config) Wait(ctx context.Context, vlab *VLAB) error
- type ConnectivityExpectation
- type ConnectivityMatrix
- func BuildConnectivityMatrix(ctx context.Context, kube kclient.Client, serverEndpoints []*Endpoint, ...) (*ConnectivityMatrix, error)
- func BuildConnectivityMatrixFromCluster(ctx context.Context, kube kclient.Client, ssh SSHResolver) (*ConnectivityMatrix, error)
- func NewConnectivityMatrix() *ConnectivityMatrix
- func (m *ConnectivityMatrix) Add(e ConnectivityExpectation)
- func (m *ConnectivityMatrix) HasProtoPortEntries(src, dst *Endpoint) bool
- func (m *ConnectivityMatrix) Lookup(src, dst *Endpoint, pp ProtoPort) ConnectivityExpectation
- func (m *ConnectivityMatrix) ProtoPortEntries(src, dst *Endpoint) []ConnectivityExpectation
- func (m *ConnectivityMatrix) ReplaceServerDrops(name string, dropped []DroppedEndpoint)
- func (m *ConnectivityMatrix) ReplaceServerEndpoints(name string, newEPs []*Endpoint)
- func (m *ConnectivityMatrix) Repopulate(ctx context.Context, kube kclient.Client) error
- func (m *ConnectivityMatrix) Validate() error
- type ConnectivityVerdict
- type CurlError
- type DHCPLeaseInfo
- type DroppedEndpoint
- type Endpoint
- type EndpointPair
- type EndpointPredicate
- type ExternalAttachCfg
- type ExternalBGPVRFCfg
- type ExternalEndpoint
- type ExternalNICCfg
- type ExternalStaticVrfCfg
- type ExternalVRFCfg
- type ExternalsCfg
- type Failure
- type GwExtPeeringOptions
- type GwPeeringOptions
- type HostBGPParams
- type HydrateMode
- type HydrationStatus
- type InitConfig
- type InspectOpts
- type InspectPodsOpts
- type IperfError
- type JUnitReport
- type JUnitTestCase
- type JUnitTestSuite
- type MultiHomedServer
- type NATMode
- type NATMutator
- type ObsEndpoint
- type OnReady
- type PingError
- type PrecacheOpts
- type ProtoPort
- type Reachability
- func IsExternalSubnetReachable(ctx context.Context, kube kclient.Reader, sourceServer, destSubnet string, ...) (Reachability, error)
- func IsServerReachable(ctx context.Context, kube kclient.Reader, sourceServer, destServer string, ...) (Reachability, error)
- func IsSubnetReachable(ctx context.Context, kube kclient.Reader, source, dest string, ...) (Reachability, error)
- func IsSubnetReachableWithGatewayPeering(ctx context.Context, kube kclient.Reader, ...) (Reachability, error)
- func IsSubnetReachableWithSwitchPeering(ctx context.Context, kube kclient.Reader, ...) (Reachability, error)
- type ReachabilityReason
- type RegistryConfig
- type ReleaseTestOpts
- type RenewalResult
- type RevertFunc
- type SSHResolver
- type ServerAttachState
- type ServerEndpoint
- type ServerNetconfOpts
- type ServerWithInterface
- type SetupPeeringsOpts
- type SetupVPCsOpts
- type ShowTechOpts
- type ShowTechScript
- type ShutdownType
- type SkipFlags
- type Skipped
- type SwitchPowerOpts
- type SwitchReinstallMode
- type SwitchReinstallOpts
- type TemplateData
- type TestConnectivityOpts
- type TestFunc
- type TranslatedAddress
- type VLAB
- type VLABAccessInfo
- type VLABAccessType
- type VLABBuilder
- type VLABBuilderBase
- type VLABBuilderDefault
- type VLABBuilderGPURail
- type VLABConfig
- type VLABNet
- type VLABNetKind
- type VLABRunOpts
- type VLABUpOpts
- type VM
- type VMConfig
- type VMSize
- type VMSizes
- type VMSwitchMode
- type VMType
- type VPCPeeringTestCtx
- type WaitReadyOpts
Constants ¶
const ( RegistryConfigFile = ".registry.yaml" FabConfigFile = "fab.yaml" IncludeDir = "include" ResultDir = "result" DefaultRepo = "ghcr.io" DefaultPrefix = "githedgehog" YAMLExt = ".yaml" TmplExt = ".tmpl" TmplYAMLExt = TmplExt + YAMLExt YAMLTmplExt = YAMLExt + TmplExt JoinTokenEnv = "HHFAB_JOIN_TOKEN" //nolint:gosec )
const ( StaticExternalNH = "172.31.255.1" StaticExternalIP = "172.31.255.5" StaticExternalPL = "24" StaticExternalDummyIface = "10.199.0.100" )
const ( LabelAppInstance = "app.kubernetes.io/instance" AlloyCtrlComponent = "alloy-ctrl" )
const ( ServerNamePrefix = "server-" HashPolicyL2 = "layer2" HashPolicyL2And3 = "layer2+3" HashPolicyL3And4 = "layer3+4" HashPolicyEncap2And3 = "encap2+3" HashPolicyEncap3And4 = "encap3+4" HashPolicyVLANAndSrcMAC = "vlan+srcmac" )
const ( VLABExtraFabric = "fabric-b" VLABInterconnectAnnotation = "hhfab.githedgehog.com/interconnect" )
The extra fabric has no gateway or virtual external. An interconnect External, annotated with the name of its peer, connects it to a leaf of the main fabric.
const ( GatewayDriverKernel = "kernel" GatewayDriverDPDK = "dpdk" )
const ( VLABDir = "vlab" VLABConfigFile = "config.yaml" VLABSSHKeyFile = "sshkey" VLABVMsDir = "vms" VLABSwitchMACTmpl = "0c:20:12:ff:%02x:00" VLABMACTmpl = "0c:20:12:fe:%02x:%02x" VLABVirtioNet = "virtio-net-pci" // VLABVirtioNetSpeed is the link speed, in Mb/s, VLAB's virtio-net NICs report. VLABVirtioNetSpeed = "10000" HHFabCfgPrefix = ".hhfab.githedgehog.com" HHFabCfgType = vlabcomp.NodeTypeAnnotation HHFabCfgTypeHW = vlabcomp.NodeTypeHW HHFabCfgLinkPrefix = "link" + HHFabCfgPrefix + "/" HHFabCfgPCIPrefix = "pci@" HHFabCfgASNPrefix = "asn" ExternalVMName = "virt-external" MaxExternalConns = 48 )
const ( VLABPCIBridgePrefix = "pcibr" VLABRootPortPrefix = "rootport" VLABNICsPerPCIBridge = 32 VLABPCIBridges = 2 VLABMaxNICs = VLABNICsPerPCIBridge * VLABPCIBridges VLABBaseSSHPort = 22000 VLABBaseDirectPort = 22100 VLABUUIDPrefix = "77924ab4-a93b-41d4-928e-" VLABUUIDTmpl = VLABUUIDPrefix + "%012d" // VLABMgmt is the management network bridge, its taps are hhmgmtp0, hhmgmtp1 and so on VLABMgmt = "hhmgmt" // VLABLink prefixes the links, hhlink0 has taps hhlink0p0 and hhlink0p1 VLABLink = "hhlink" // VLABLegacyMgmt and VLABLegacyMgmtTap are the management network's previous names, kept to clean it up VLABLegacyMgmt = "hhbr" VLABLegacyMgmtTap = "hhtap" // VLABMaxMgmtTaps caps the management network taps VLABMaxMgmtTaps = 100 // VLABLinkMTU leaves room above the 9100 of the fabric links, a bridge drops frames bigger than the tap they leave by VLABLinkMTU = 9216 )
const ( NICTypeSep = ":" NICTypeNoop = "noop" NICTypeUsernet = "usernet" NICTypeManagement = "management" NICTypeDirect = "direct" NICTypePassthrough = "passthrough" )
const ( VLABOSImageFile = "os.img" VLABEFICodeFile = "efi_code.fd" VLABEFIVarsFile = "efi_vars.fd" VLABUSBImageFile = "usb.img" VLABISOImageFile = "usb.iso" VLABSerialLog = "serial.log" VLABSerialSock = "serial.sock" VLABMonSock = "mon.sock" VLABQMPSock = "qmp.sock" VLABCmdSudo = "sudo" VLABCmdQemuImg = "qemu-img" VLABCmdQemuSystem = "qemu-system-x86_64" VLABCmdSocat = "socat" VLABCmdSSH = "ssh" VLABCmdSCP = "scp" VLABCmdLess = "less" VLABCmdExpect = "expect" VLABButane = "butane.yaml" VLABIgnition = "ignition.json" VLABKubeConfig = "kubeconfig" VLABEnvPDUUsername = "HHFAB_VLAB_PDU_USERNAME" VLABEnvPDUPassword = "HHFAB_VLAB_PDU_PASSWORD" //nolint:gosec VLABEnvSwitchUsername = "HHFAB_SWITCH_USERNAME" VLABEnvSwitchPassword = "HHFAB_SWITCH_PASSWORD" //nolint:gosec VLABEnvServerUsername = "HHFAB_SERVER_USERNAME" VLABEnvServerPassword = "HHFAB_SERVER_PASSWORD" //nolint:gosec VLABEnvExternalUsername = "HHFAB_EXTERNAL_USERNAME" VLABEnvExternalPassword = "HHFAB_EXTERNAL_PASSWORD" //nolint:gosec VLABEnvExternalMgmtIP = "HHFAB_EXTERNAL_MGMT_IP" )
const ControlPlaneAPIIP = "172.30.0.5"
const DefaultGatewayWorkers = 4
DefaultGatewayWorkers is the number of dataplane workers of VLAB gateways. DPDK busy-polls each of them, so every worker keeps a host core busy.
const (
DefaultVLABGeneratedFile = "vlab.generated.yaml"
)
const HydrateNumberedLinksAnnotation = "hydrate.hhfab.githedgehog.com/numbered-links"
HydrateNumberedLinksAnnotation set to "true" on a Fabric makes hydration assign /31s to its fabric and mesh links instead of leaving them empty for BGP unnumbered
const UpgradeFromEnv = "HHFAB_UPGRADE_FROM"
UpgradeFromEnv names the release a work dir is being upgraded from, e.g. 26.04 or 26.04.1. Wiring written for a release from before Fabric objects has no Fabric/default, which validation requires and which the controller creates in the cluster on upgrade. For those releases hhfab injects it when loading the wiring, so the rest of the upgrade sees what the cluster will. VLAB upgrades also skip the config export and import check for releases whose k3s can't start on the current VLAB before the upgrade.
Keyed on the release rather than on the wiring lacking a Fabric, so that it stops applying by itself once those releases are no longer upgraded from.
TODO: remove once upgrades from 26.03 and 26.04 are no longer supported.
const VLABExtraDomain = "domain-b"
Variables ¶
var ( ErrExist = fmt.Errorf("already exists") ErrNotExist = fmt.Errorf("does not exist") ErrNotDir = fmt.Errorf("not a directory") )
var ( ErrConsole = errors.New("connection to console failed") ErrLogin = errors.New("login to switch failed") ErrInstall = errors.New("os install failed") ErrHHFab = errors.New("hhfab vlab serial failed") ErrUnknown = errors.New("unknown expect error") )
var AllOnReady = []OnReady{ OnReadyExit, OnReadySetupVPCs, OnReadySetupPeerings, OnReadySwitchReinstall, OnReadyTestConnectivity, OnReadyWait, OnReadyInspect, OnReadyInspectPods, OnReadyReleaseTest, }
var AllZeroPrefix = []string{"0.0.0.0/0"}
var DefaultSizes = VMSizes{ Control: VMSize{CPU: 6, RAM: 6144, Disk: 100}, Switch: VMSize{CPU: 4, RAM: 5120, Disk: 50}, Server: VMSize{CPU: 2, RAM: 768, Disk: 14}, Gateway: VMSize{CPU: 8, RAM: 8192, Disk: 50}, External: VMSize{CPU: 4, RAM: 5120, Disk: 50}, }
var ErrExit = fmt.Errorf("exit")
var GatewayDrivers = []string{ GatewayDriverKernel, GatewayDriverDPDK, }
var HashPolicies = []string{ HashPolicyL2, HashPolicyL2And3, HashPolicyL3And4, HashPolicyEncap2And3, HashPolicyEncap3And4, HashPolicyVLANAndSrcMAC, }
var HydrateModes = []HydrateMode{ HydrateModeNever, HydrateModeIfNotPresent, HydrateModeOverride, }
var NICTypes = []string{ NICTypeNoop, NICTypeUsernet, NICTypeManagement, NICTypeDirect, NICTypePassthrough, }
var ReinstallModes = []SwitchReinstallMode{ ReinstallModeReboot, ReinstallModeHardReset, }
var SSHQuietFlags = []string{
"-o", "GlobalKnownHostsFile=/dev/null",
"-o", "UserKnownHostsFile=/dev/null",
"-o", "StrictHostKeyChecking=no",
"-o", "LogLevel=ERROR",
"-o", "IdentitiesOnly=yes",
}
var VLABCmds = []string{ VLABCmdSudo, VLABCmdQemuImg, VLABCmdQemuSystem, VLABCmdSocat, VLABCmdSSH, VLABCmdLess, }
var VLABNetKinds = []VLABNetKind{ VLABNetKindMgmt, VLABNetKindLink, }
var VMSwitchModes = []VMSwitchMode{ VMSwitchModeONIE, VMSwitchModeImage, }
var VMTypes = []VMType{ VMTypeControl, VMTypeSwitch, VMTypeServer, VMTypeGateway, VMTypeExternal, }
Functions ¶
func AirGenerate ¶ added in v0.44.0
func AirGenerate(ctx context.Context, workDir, cacheDir string, hMode HydrateMode) error
func CollectServerEndpoints ¶ added in v0.49.0
func CollectServerEndpoints(ctx context.Context, kube kclient.Client, ssh SSHResolver, servers []string) ([]*Endpoint, []DroppedEndpoint, error)
CollectServerEndpoints observes the live cluster and produces one *Endpoint per (server, vpc, subnet) attachment for each server in the `servers` filter (nil → all servers attached to at least one VPC).
func CreateOrUpdateVpc ¶ added in v0.34.0
func DoSetupPeerings ¶ added in v0.34.0
func DoSetupPeerings(ctx context.Context, kube kclient.Client, vpcPeerings map[string]*vpcapi.VPCPeeringSpec, externalPeerings map[string]*vpcapi.ExternalPeeringSpec, gwPeerings map[string]*gwapi.PeeringSpec, waitReady bool, ) error
func DoShowTech ¶ added in v0.34.0
func DoSwitchPower ¶ added in v0.33.0
func DoSwitchPower(ctx context.Context, workDir, cacheDir string, opts SwitchPowerOpts) error
func DoSwitchReinstall ¶ added in v0.33.0
func DoSwitchReinstall(ctx context.Context, workDir, cacheDir string, opts SwitchReinstallOpts) error
func DoVLABBenchAgents ¶ added in v0.51.0
func DoVLABBenchAgents(ctx context.Context, workDir, cacheDir string, opts BenchAgentsOpts) error
DoVLABBenchAgents simulates switch agents against the Agent objects in the cluster.
func DoVLABBenchBoots ¶ added in v0.51.0
func DoVLABBenchBoots(ctx context.Context, workDir, cacheDir string, opts BenchBootsOpts) error
DoVLABBenchBoots simulates every bench switch reinstalling itself from fabric-boot through ONIE, all at once.
func DoVLABBenchClean ¶ added in v0.51.0
func DoVLABBenchClean(ctx context.Context, workDir, cacheDir string, opts BenchCleanOpts) error
DoVLABBenchClean removes everything the benchmark created.
func DoVLABBenchDHCP ¶ added in v0.51.0
func DoVLABBenchDHCP(ctx context.Context, workDir, cacheDir string, opts BenchDHCPOpts) error
DoVLABBenchDHCP storms fabric-dhcpd with a fleet of servers booting at once, relayed from a bench leaf's management IP. Binding the relay's port 67 needs root, so without it this fails, or with Sudo runs itself again under sudo.
func DoVLABBenchHealth ¶ added in v0.51.0
func DoVLABBenchHealth(ctx context.Context, workDir, cacheDir string, opts BenchHealthOpts) error
DoVLABBenchHealth prints the current state of the control plane.
func DoVLABBenchInit ¶ added in v0.51.0
func DoVLABBenchInit(ctx context.Context, workDir, cacheDir string, opts BenchInitOpts) error
DoVLABBenchInit generates the benchmark topology and applies it to the VLAB control node.
func DoVLABBenchSample ¶ added in v0.51.0
func DoVLABBenchSample(ctx context.Context, workDir, cacheDir string, opts BenchSampleOpts) error
DoVLABBenchSample records etcd and control node memory over time, to a file bench health reads back.
It is deliberately its own command rather than part of a load generator: what it observes is a property of the cluster, not of any particular load, so it runs alongside agents, users, init, or nothing at all. Unlike health, where the control node is one section of several, it is the whole point here - so a missing one fails rather than quietly producing an empty series.
func DoVLABBenchUsers ¶ added in v0.51.0
func DoVLABBenchUsers(ctx context.Context, workDir, cacheDir string, opts BenchUsersOpts) error
DoVLABBenchUsers simulates operators changing objects and running inspect.
func DoVLABInspect ¶ added in v0.34.0
func DoVLABInspect(ctx context.Context, workDir, cacheDir string, opts InspectOpts) error
func DoVLABInspectPods ¶ added in v0.50.3
func DoVLABInspectPods(ctx context.Context, workDir, cacheDir string, opts InspectPodsOpts) error
func DoVLABReleaseTest ¶ added in v0.35.0
func DoVLABReleaseTest(ctx context.Context, workDir, cacheDir string, opts ReleaseTestOpts) error
func DoVLABSerial ¶
func DoVLABSerialLog ¶
func DoVLABSetupPeerings ¶
func DoVLABSetupPeerings(ctx context.Context, workDir, cacheDir string, opts SetupPeeringsOpts) error
func DoVLABSetupVPCs ¶
func DoVLABSetupVPCs(ctx context.Context, workDir, cacheDir string, opts SetupVPCsOpts) ([]*Endpoint, []DroppedEndpoint, error)
func DoVLABTestConnectivity ¶
func DoVLABTestConnectivity(ctx context.Context, workDir, cacheDir string, opts TestConnectivityOpts) error
func DoVLABTestConnectivityWithMatrix ¶ added in v0.49.0
func DoVLABTestConnectivityWithMatrix(ctx context.Context, workDir, cacheDir string, opts TestConnectivityOpts, matrix *ConnectivityMatrix) error
func DoVLABWait ¶ added in v0.34.0
func GetServerNetconfCmd ¶ added in v0.41.0
func GetServerNetconfCmd(conn *wiringapi.Connection, opts ServerNetconfOpts) (string, error)
func IsSameEndpointNode ¶ added in v0.49.0
func LoadTemplateValues ¶ added in v0.51.0
LoadTemplateValues builds the template values used to render the imported config and wiring files. Values files are merged left-to-right, then the k=v entries from sets are applied on top. The result is never nil.
func OverlayMatrixNAT ¶ added in v0.49.0
func OverlayMatrixNAT( matrix *ConnectivityMatrix, srcPred, dstPred EndpointPredicate, mutator NATMutator, ) error
func PrecacheVLABOCI ¶ added in v0.44.0
func PrecacheVLABOCI(cfg fabapi.Fabricator) (comp.OCIArtifacts, error)
PrecacheVLABOCI returns a list of OCI artifacts that are required for building the VLAB
func PrecacheVLABORAS ¶ added in v0.44.0
func PrecacheVLABORAS(cfg fabapi.Fabricator) (comp.OCIArtifacts, error)
PrecacheVLABORAS returns a list of ORAS artifacts that are required for building the VLAB
func ReleaseTest ¶ added in v0.48.0
func ResolveDefaultServerMTU ¶ added in v0.47.0
ResolveDefaultServerMTU sets opts.InterfaceMTU to a sensible default when left at 0, based on the switch profiles present in the cluster:
- SONiC VS: 1500 when DNS/NTP options are set (forces a non-jumbo advertisement via DHCP to avoid the API webhook defaulting to 9036); left at 0 otherwise so no MTU is advertised.
- Otherwise: fabcomp.ServerFacingMTU (jumbo).
Idempotent: no-op when opts.InterfaceMTU is already non-zero. Callers that need the resolved value back in their own SetupVPCsOpts (e.g. release-test drivers that later read testCtx.setupOpts.InterfaceMTU) must invoke this before constructing that context, since SetupVPCs receives opts by value.
func RunReleaseTestSuites ¶ added in v0.35.0
func SetupVLABNet ¶ added in v0.51.0
SetupVLABNet makes the host match the nets given: creates the missing bridges and taps, recreates the ones set up differently and deletes all the others VLAB owns, the management network's legacy names included
func SubPrefixesFrom ¶
func VLABGenerate ¶
func Validate ¶
func Validate(ctx context.Context, workDir, cacheDir string, hMode HydrateMode) error
Types ¶
type AirServersIn ¶ added in v0.44.0
type AirServersIn struct {
Servers map[string]AirServersInServer
}
type AirServersInServer ¶ added in v0.44.0
type AirServersInServer struct {
Ifaces map[string]AirServersInServerIface
Routes map[string]AirServersInServerRoute
}
type AirServersInServerIface ¶ added in v0.44.0
type AirServersInServerIface struct {
IP string
}
type AirServersInServerRoute ¶ added in v0.44.0
type AirServersInServerRoute struct {
NextHops []string
}
type AirTopoIn ¶ added in v0.44.0
type AirTopoIn struct {
Nodes []AirTopoNode
Links []AirTopoLink
}
type AirTopoLink ¶ added in v0.44.0
type AirTopoLink struct {
Endpoints []AirTopoLinkEndpoint
}
type AirTopoLinkEndpoint ¶ added in v0.44.0
type AirTopoNode ¶ added in v0.44.0
type AttachedServerInfo ¶ added in v0.44.0
type AttachedServerInfo struct {
ServerName string
Interface string
VPCName string
SubnetName string
VPC *vpcapi.VPC
Subnet *vpcapi.VPCSubnet
Connection *wiringapi.Connection
}
AttachedServerInfo contains information about a server attached to a VPC subnet.
type BenchAgentsOpts ¶ added in v0.51.0
type BenchAgentsOpts struct {
Duration time.Duration
Interval time.Duration
ApplyDelay time.Duration
Agents []string
APIVia string
SyncHeartbeats bool
PadSize string
QPS float32
Burst int
}
BenchAgentsOpts configures `hhfab vlab bench agents`.
type BenchBootsOpts ¶ added in v0.51.0
type BenchBootsOpts struct {
Rounds int
Switches []string
LogLines int
InstallTime time.Duration
RetryDelay time.Duration
MaxFailures int
QPS float32
Burst int
}
BenchBootsOpts configures `hhfab vlab bench boots`.
type BenchCleanOpts ¶ added in v0.51.0
BenchCleanOpts configures `hhfab vlab bench clean`.
type BenchDHCPOpts ¶ added in v0.51.0
type BenchDHCPOpts struct {
Servers int
Subnets int
VPCs int
MaxSubnetServers int
Rounds int
Repeats int
RepeatInterval time.Duration
Spread time.Duration
RoundTimeout time.Duration
PXE bool
Relay string
Sudo bool
QPS float32
Burst int
}
BenchDHCPOpts configures `hhfab vlab bench dhcp`.
type BenchHealthOpts ¶ added in v0.51.0
BenchHealthOpts configures `hhfab vlab bench health`.
type BenchInitOpts ¶ added in v0.51.0
type BenchInitOpts struct {
Fabrics []string
Workers int
QPS float32
Burst int
Phase string
Force bool
DryRun bool
Out string
// SkipValidate bypasses the local check, leaving it to the admission
// webhooks. Worth it on a large run, where validating locally costs more
// than the apply.
SkipValidate bool
// DefaultFabric puts every switch in the default fabric, without Fabric
// objects or fabric and domain fields, so the topology can be created on a
// release from before them and carried through the upgrade.
DefaultFabric bool
}
BenchInitOpts configures `hhfab vlab bench init`.
type BenchSampleOpts ¶ added in v0.51.0
BenchSampleOpts configures `hhfab vlab bench sample`.
type BenchUsersOpts ¶ added in v0.51.0
type BenchUsersOpts struct {
Duration time.Duration
UpdateWorkers int
UpdateSleep time.Duration
InspectWorkers int
InspectSleep time.Duration
Kinds []string
Inspects []string
Fabrics []string
OpTimeout time.Duration
InspectOneSwitch bool
QPS float32
Burst int
}
BenchUsersOpts configures `hhfab vlab bench users`.
type Config ¶
type Config struct {
WorkDir string
CacheDir string
ExtraCacheDirs []string
RegistryConfig
Fab fabapi.Fabricator
Controls []fabapi.ControlNode
Nodes []fabapi.FabNode
Client kclient.Client // all resources (fab, fabric and gateway)
Shutdown atomic.Int32
}
func (*Config) AirGenerate ¶ added in v0.44.0
func (*Config) CollectVLABDebug ¶ added in v0.41.2
func (*Config) InspectPods ¶ added in v0.50.3
func (c *Config) InspectPods(ctx context.Context, opts InspectPodsOpts) error
func (*Config) PrepareVLAB ¶
func (*Config) SetupPeerings ¶
SetupPeerings creates/updates peerings per opts.Requests. It is matrix- agnostic: callers that want a post-peering connectivity expectation map invoke BuildConnectivityMatrix separately. See matrix.go for the model.
func (*Config) SetupVPCs ¶
func (c *Config) SetupVPCs(ctx context.Context, vlab *VLAB, opts SetupVPCsOpts) ([]*Endpoint, []DroppedEndpoint, error)
SetupVPCs creates VPCs and VPC attachments per opts, configures servers, and returns one Endpoint per (server, vpc, subnet) attachment with the discovered IP and HostBGP flag populated.
func (*Config) TestConnectivity ¶
func (*Config) TestConnectivityWithMatrix ¶ added in v0.49.0
func (c *Config) TestConnectivityWithMatrix(ctx context.Context, vlab *VLAB, opts TestConnectivityOpts, matrix *ConnectivityMatrix) error
func (*Config) VLABAccess ¶
func (*Config) VLABShowTech ¶ added in v0.34.0
func (*Config) VLABSwitchPower ¶ added in v0.33.0
func (c *Config) VLABSwitchPower(ctx context.Context, opts SwitchPowerOpts) error
func (*Config) VLABSwitchReinstall ¶ added in v0.33.0
func (c *Config) VLABSwitchReinstall(ctx context.Context, opts SwitchReinstallOpts) error
type ConnectivityExpectation ¶ added in v0.49.0
type ConnectivityExpectation struct {
Pair EndpointPair
Verdict ConnectivityVerdict
NAT *TranslatedAddress
Reason ReachabilityReason
Peering string
// free-form context for Reason: why a VerdictUnknown entry could not be
// evaluated, or what withholds a VerdictDeny (e.g. an ACL on the peering)
Detail string
ProtoPort ProtoPort
}
ConnectivityExpectation describes what should happen on a directional path.
type ConnectivityMatrix ¶ added in v0.49.0
type ConnectivityMatrix struct {
// Canonical, ordered list of all endpoints in the matrix.
AllEndpoints []*Endpoint
// contains filtered or unexported fields
}
func BuildConnectivityMatrix ¶ added in v0.49.0
func BuildConnectivityMatrix(ctx context.Context, kube kclient.Client, serverEndpoints []*Endpoint, dropped []DroppedEndpoint) (*ConnectivityMatrix, error)
func BuildConnectivityMatrixFromCluster ¶ added in v0.49.0
func BuildConnectivityMatrixFromCluster(ctx context.Context, kube kclient.Client, ssh SSHResolver) (*ConnectivityMatrix, error)
func NewConnectivityMatrix ¶ added in v0.49.0
func NewConnectivityMatrix() *ConnectivityMatrix
func (*ConnectivityMatrix) Add ¶ added in v0.49.0
func (m *ConnectivityMatrix) Add(e ConnectivityExpectation)
Add inserts or replaces the expectation for (Pair, ProtoPort).
func (*ConnectivityMatrix) HasProtoPortEntries ¶ added in v0.49.0
func (m *ConnectivityMatrix) HasProtoPortEntries(src, dst *Endpoint) bool
func (*ConnectivityMatrix) Lookup ¶ added in v0.49.0
func (m *ConnectivityMatrix) Lookup(src, dst *Endpoint, pp ProtoPort) ConnectivityExpectation
func (*ConnectivityMatrix) ProtoPortEntries ¶ added in v0.49.0
func (m *ConnectivityMatrix) ProtoPortEntries(src, dst *Endpoint) []ConnectivityExpectation
func (*ConnectivityMatrix) ReplaceServerDrops ¶ added in v0.49.0
func (m *ConnectivityMatrix) ReplaceServerDrops(name string, dropped []DroppedEndpoint)
func (*ConnectivityMatrix) ReplaceServerEndpoints ¶ added in v0.49.0
func (m *ConnectivityMatrix) ReplaceServerEndpoints(name string, newEPs []*Endpoint)
ReplaceServerEndpoints reconciles the matrix's endpoints for one server against newEPs:
- Existing endpoints whose (vpc, subnet) match an entry in newEPs are updated in place
- Existing endpoints with no (vpc, subnet) match in newEPs are dropped
- newEPs that don't match any existing endpoint are appended
func (*ConnectivityMatrix) Repopulate ¶ added in v0.49.0
Repopulate clears the matrix's expectation entries and refills Allow entries by querying the live cluster for reachability between every (src, dst) endpoint pair in AllEndpoints.
func (*ConnectivityMatrix) Validate ¶ added in v0.49.0
func (m *ConnectivityMatrix) Validate() error
type ConnectivityVerdict ¶ added in v0.49.0
type ConnectivityVerdict string
const ( VerdictAllow ConnectivityVerdict = "allow" VerdictDeny ConnectivityVerdict = "deny" VerdictUnknown ConnectivityVerdict = "unknown" )
type CurlError ¶ added in v0.43.0
type DHCPLeaseInfo ¶ added in v0.44.0
type DroppedEndpoint ¶ added in v0.49.0
DroppedEndpoint records an attachment or address that endpoint discovery could not turn into a testable *Endpoint. ConnectivityMatrix.Validate() refuses to run a test against a matrix that carries any of these.
func (DroppedEndpoint) String ¶ added in v0.49.0
func (d DroppedEndpoint) String() string
type Endpoint ¶ added in v0.49.0
type Endpoint struct {
Server *ServerEndpoint
External *ExternalEndpoint
}
Endpoint is a tagged union; exactly one of Server, External is non-nil.
type EndpointPair ¶ added in v0.49.0
type EndpointPredicate ¶ added in v0.49.0
func ExternalNamed ¶ added in v0.49.0
func ExternalNamed(name string) EndpointPredicate
func ServerInVPC ¶ added in v0.49.0
func ServerInVPC(vpc string) EndpointPredicate
type ExternalAttachCfg ¶ added in v0.37.0
type ExternalAttachCfg struct {
IsStatic bool `json:"isStatic"` // whether this is a static attachment (as opposed to a BGP speaker)
Prefix string `json:"prefix"` // IP prefix to configure on the NIC
NeighborIP string `json:"neighborIP"` // IP address of the BGP neighbor or static external
NeighborASN string `json:"neighborASN"` // ASN of the BGP neighbor (only for BGP externals)
Vlan uint16 `json:"vlan"` // VLAN ID to configure on the NIC, 0 is untagged
VRF string `json:"vrf"` // VRF name to configure on the NIC (name of the external)
}
type ExternalBGPVRFCfg ¶ added in v0.44.0
type ExternalEndpoint ¶ added in v0.49.0
type ExternalNICCfg ¶ added in v0.37.0
type ExternalNICCfg struct {
Attachments []ExternalAttachCfg `json:"attachments"` // the external attachments for this NIC, one per VLAN
Untagged bool `json:"untagged"` // whether there's an untagged attachment. Separate to simplify ignition template
UntaggedCfg ExternalAttachCfg `json:"untaggedCfg"` // if untagged, the configuration for the untagged attachment
}
type ExternalStaticVrfCfg ¶ added in v0.44.0
type ExternalStaticVrfCfg struct {
Prefixes []string `json:"prefixes"` // the prefixes reachable via this external
GatewayIPs []string `json:"gatewayIPs"` // the addresses that can be used on the gateway to connect to this external
SwitchIP string `json:"switchIP"` // the address on the switch on the other side of the attachment
NICName string `json:"nicName"` // name of the NIC attachment
NATPoolCIDR string `json:"natPoolCIDR"` // NAT pool CIDR that the gateway source-NATs into; installs a return route toward the switch
IPv4NamespaceSubnets []string `json:"ipv4NamespaceSubnets"` // subnets of the IPv4 namespaces in the external's fabric; each gets a return route toward the switch
}
type ExternalVRFCfg ¶ added in v0.37.0
type ExternalVRFCfg struct {
IsStatic bool `json:"isStatic"` // whether this is a static external (as opposed to a BGP speaker)
TableID uint32 `json:"tableID"` // the VRF table ID
BGPCfg ExternalBGPVRFCfg `json:"bgpCfg"`
StaticCfg ExternalStaticVrfCfg `json:"staticCfg"`
}
type ExternalsCfg ¶ added in v0.37.0
type ExternalsCfg struct {
NICs map[string]ExternalNICCfg `json:"nics"` // the key is the external connection NIC name
VRFs map[string]ExternalVRFCfg `json:"vrfs"` // a VRF associated with an external. The key is the external name
}
type GwExtPeeringOptions ¶ added in v0.47.0
type GwExtPeeringOptions struct {
// VPCSubnets specifies which subnets from VPC to expose (if empty, all subnets are used)
VPCSubnets []string
// VPCNATCIDR specifies the NAT CIDR ranges for VPC
VPCNATCIDR []string
// VPCNATMode specifies the NAT mode for VPC (default: static)
VPCNATMode NATMode
// VPCPortForwardRules specifies port-forwarding rules for VPC
VPCPortForwardRules []gwapi.PeeringNATPortForwardEntry
}
GwExtPeeringOptions contains optional parameters for gateway external peering configuration
type GwPeeringOptions ¶ added in v0.44.0
type GwPeeringOptions struct {
// VPC1Subnets specifies which subnets from VPC1 to expose (if empty, all subnets are used)
VPC1Subnets []string
// VPC2Subnets specifies which subnets from VPC2 to expose (if empty, all subnets are used)
VPC2Subnets []string
// VPC1NATCIDR specifies the NAT CIDR ranges for VPC1
VPC1NATCIDR []string
// VPC2NATCIDR specifies the NAT CIDR ranges for VPC2
VPC2NATCIDR []string
// VPC1NATMode specifies the NAT mode for VPC1 (default: static)
VPC1NATMode NATMode
// VPC2NATMode specifies the NAT mode for VPC2 (default: static)
VPC2NATMode NATMode
// VPC1PortForwardRules specifies port-forwarding rules for VPC1
VPC1PortForwardRules []gwapi.PeeringNATPortForwardEntry
// VPC2PortForwardRules specifies port-forwarding rules for VPC2
VPC2PortForwardRules []gwapi.PeeringNATPortForwardEntry
// ACL is an optional peering-scoped ACL applied to the gateway peering.
ACL *gwapi.PeeringACL
// VPC1NotCIDRs specifies CIDRs to exclude from VPC1's exposed prefixes
VPC1NotCIDRs []string
// VPC2NotCIDRs specifies CIDRs to exclude from VPC2's exposed prefixes
VPC2NotCIDRs []string
}
GwPeeringOptions contains optional parameters for gateway peering configuration
type HostBGPParams ¶ added in v0.49.0
type HydrateMode ¶
type HydrateMode string
const ( HydrateModeNever HydrateMode = "never" HydrateModeIfNotPresent HydrateMode = "if-not-present" HydrateModeOverride HydrateMode = "override" )
type HydrationStatus ¶
type HydrationStatus string
const ( HydrationStatusNone HydrationStatus = "none" HydrationStatusPartial HydrationStatus = "partial" HydrationStatusFull HydrationStatus = "full" )
type InitConfig ¶
type InspectOpts ¶ added in v0.34.0
type InspectPodsOpts ¶ added in v0.50.3
type IperfError ¶ added in v0.43.0
type IperfError struct {
Source string
Destination string
Why string // what made the expectation what it is
MinSpeed string
SentSpeed string
RcvdSpeed string
ClientMsg string
ServerMsg string
SendSpeedTooLow bool
}
func (*IperfError) Error ¶ added in v0.43.0
func (ie *IperfError) Error() string
type JUnitReport ¶ added in v0.35.0
type JUnitReport struct {
XMLName xml.Name `xml:"testsuites"`
Suites []JUnitTestSuite `xml:"testsuite"`
}
type JUnitTestCase ¶ added in v0.35.0
type JUnitTestCase struct {
XMLName xml.Name `xml:"testcase"`
ClassName string `xml:"classname,attr"`
Name string `xml:"name,attr"`
Time float64 `xml:"time,attr"`
Failure *Failure `xml:"failure,omitempty"`
Skipped *Skipped `xml:"skipped,omitempty"`
F TestFunc `xml:"-"` // function to run
SkipFlags SkipFlags `xml:"-"` // flags to determine whether to skip the test
}
type JUnitTestSuite ¶ added in v0.35.0
type JUnitTestSuite struct {
XMLName xml.Name `xml:"testsuite"`
Name string `xml:"name,attr"`
Tests int `xml:"tests,attr"`
Failures int `xml:"failures,attr"`
Skipped int `xml:"skipped,attr"`
Time float64 `xml:"time,attr"`
TimeHuman time.Duration `xml:"-"`
TestCases []JUnitTestCase `xml:"testcase"`
}
type MultiHomedServer ¶ added in v0.49.0
type MultiHomedServer struct {
Server *wiringapi.Server
Connections []*wiringapi.Connection
SwitchConns map[string][]*wiringapi.Connection
}
type NATMode ¶ added in v0.44.0
type NATMode int
NATMode specifies the type of NAT to use
const ( // NATModeStatic uses static (1:1) NAT mapping NATModeStatic NATMode = iota // NATModeMasquerade uses masquerade (many:1) NAT with connection tracking NATModeMasquerade // NATModePortForward uses port-forwarding NAT NATModePortForward // NATModeMasqueradePortForward uses combined masquerade and port-forwarding NAT (two separate expose entries) NATModeMasqueradePortForward )
type NATMutator ¶ added in v0.49.0
type NATMutator func(src, dst *Endpoint, nat *TranslatedAddress) error
type ObsEndpoint ¶ added in v0.43.0
Structure to hold observability endpoint details
type OnReady ¶
type OnReady string
const ( OnReadyExit OnReady = "exit" OnReadySetupVPCs OnReady = "setup-vpcs" OnReadySetupPeerings OnReady = "setup-peerings" OnReadySwitchReinstall OnReady = "switch-reinstall" OnReadyTestConnectivity OnReady = "test-connectivity" OnReadyWait OnReady = "wait" OnReadyInspect OnReady = "inspect" OnReadyInspectPods OnReady = "inspect-pods" OnReadyReleaseTest OnReady = "release-test" )
func FromShortOnReady ¶ added in v0.43.0
type PingError ¶ added in v0.43.0
type PrecacheOpts ¶ added in v0.44.0
type Reachability ¶ added in v0.41.0
type Reachability struct {
Reachable bool
Reason ReachabilityReason
Peering string
Detail string
// Ranges a gateway peering subtracts from the source's and the destination's own
// expose via `Not`. Reachable above is subnet-level, so callers that know the
// endpoint addresses narrow it with Excludes.
SourceExclusions []netip.Prefix
DestExclusions []netip.Prefix
}
func IsExternalSubnetReachable ¶ added in v0.43.0
func IsServerReachable ¶ added in v0.39.0
func IsSubnetReachable ¶ added in v0.39.0
func IsSubnetReachableWithGatewayPeering ¶ added in v0.41.0
func IsSubnetReachableWithGatewayPeering(ctx context.Context, kube kclient.Reader, vpc1Name, vpc1Subnet, vpc2Name, vpc2Subnet string) (Reachability, error)
It's just a temporary function for simple check only supporting whole VPC subnet CIDRs
func IsSubnetReachableWithSwitchPeering ¶ added in v0.41.0
func (Reachability) Excludes ¶ added in v0.50.2
func (r Reachability) Excludes(sourceAddr, destAddr netip.Addr) bool
Excludes reports whether a gateway peering `Not` takes this pair of addresses out of an otherwise reachable peering. Both directions: traffic to an excluded host is dropped, and its own traffic has no return path.
type ReachabilityReason ¶ added in v0.41.0
type ReachabilityReason string
const ( ReachabilityReasonIntraVPC ReachabilityReason = "intra-vpc" ReachabilityReasonSwitchPeering ReachabilityReason = "switch-peering" ReachabilityReasonGatewayPeering ReachabilityReason = "gateway-peering" )
type RegistryConfig ¶
type ReleaseTestOpts ¶ added in v0.35.0
type RenewalResult ¶ added in v0.44.0
type RevertFunc ¶ added in v0.35.0
A revert function is a function that undoes a step taken by the test. It is meant to be run after the test is done, regardless of whether it succeeded or failed.
type SSHResolver ¶ added in v0.49.0
func SSHResolverFromMap ¶ added in v0.49.0
func SSHResolverFromMap(m map[string]*sshutil.Config) SSHResolver
type ServerAttachState ¶ added in v0.42.0
type ServerEndpoint ¶ added in v0.49.0
type ServerNetconfOpts ¶ added in v0.44.0
type ServerWithInterface ¶ added in v0.44.0
type SetupPeeringsOpts ¶
type SetupVPCsOpts ¶
type ShowTechOpts ¶ added in v0.44.0
type ShowTechOpts struct {
// If empty, defaults to WorkDir/show-tech-output.
OutputDir string
}
type ShowTechScript ¶ added in v0.34.0
func DefaultShowTechScript ¶ added in v0.34.0
func DefaultShowTechScript() ShowTechScript
type ShutdownType ¶ added in v0.44.0
type ShutdownType int32
const ( ShutdownTypeError ShutdownType = iota ShutdownTypeGraceful )
type SkipFlags ¶ added in v0.35.0
type SkipFlags struct {
VirtualSwitch bool `xml:"-"` // skip if there's any virtual switch in the vlab
NoBGPExternals bool `xml:"-"` // skip if there are no viable BGP externals
NoStaticExternals bool `xml:"-"` // skip if there are no viable static externals
ExtendedOnly bool `xml:"-"` // skip if extended tests are not enabled
RoCE bool `xml:"-"` // skip if RoCE is not supported by any of the leaf switches
SubInterfaces bool `xml:"-"` // skip if subinterfaces are not supported by some of the switches
NoFabricLink bool `xml:"-"` // skip if there's no fabric (i.e. spine-leaf) link between the switches
NoMeshLink bool `xml:"-"` // skip if there's no mesh (i.e. leaf-leaf) link between the switches
NoGateway bool `xml:"-"` // skip if gateway is not enabled or no gateways available
NoLoki bool `xml:"-"` // skip if Loki is not configured or available
NoProm bool `xml:"-"` // skip if Prometheus is not configured or available
NoServers bool `xml:"-"` // skip if there are no servers in the fabric
}
func (*SkipFlags) PrettyPrint ¶ added in v0.43.0
type SwitchPowerOpts ¶ added in v0.33.0
type SwitchReinstallMode ¶ added in v0.33.0
type SwitchReinstallMode string
const ( ReinstallModeReboot SwitchReinstallMode = "reboot" ReinstallModeHardReset SwitchReinstallMode = "hard-reset" )
type SwitchReinstallOpts ¶ added in v0.33.0
type SwitchReinstallOpts struct {
Switches []string // All switches if empty
Mode SwitchReinstallMode // "reboot" or "hard-reset"
SwitchUsername string // Username for switch access (reboot mode only )
SwitchPassword string // Password for switch access (reboot mode only)
PDUUsername string // (hard-reset mode only)
PDUPassword string // (hard-reset mode only)
WaitReady bool // Wait for the switch to be ready
}
type TemplateData ¶ added in v0.51.0
type TemplateData struct {
// Values is what --values and --set produced
Values map[string]any
// Version is the hhfab version, component versions live under Fab.Status.Versions
Version string
// Release is the user-facing release version of the whole project, e.g. "26.04.0"
Release string
// Fab is the fabricator, with defaults merged in and versions calculated. For the config
// it only holds the defaults, for the wiring it's the config after evaluation.
Fab fabapi.Fabricator
// Controls and Nodes are the control and fab nodes from the same config, keyed by name,
// and empty for the config itself. Look one up with `index .Controls "control-1"` and
// iterate with `range $name, $c := .Controls` -- text/template ranges maps in key order,
// so the iteration is deterministic.
Controls map[string]fabapi.ControlNode
Nodes map[string]fabapi.FabNode
}
TemplateData is the context available to a templated config or wiring file. Values is a map, so referencing an absent key yields an empty string (Helm-like); the rest are Go structs, where an unknown field is a template error.
type TestConnectivityOpts ¶
type TestFunc ¶ added in v0.35.0
type TestFunc func(context.Context, *VPCPeeringTestCtx, *ConnectivityMatrix) (bool, []RevertFunc, error)
A test function is a function that runs a test. It takes a go context, a test context, and a connectivity matrix, and returns a boolean indicating whether the test was skipped (e.g. due to missing resources), a list of revert functions to be run after the test, and an error if the test failed. note that the error contains the reason for the skip if the test was skipped.
type TranslatedAddress ¶ added in v0.49.0
type TranslatedAddress struct {
// SourcePool: CIDR from which the destination may observe any source IP
SourcePool netip.Prefix
// DestinationIP: IP the source must target to reach the destination
DestinationIP netip.Addr
// DestinationPort: port the destination actually listens on, when
// different from the source-facing port. Zero means no port translation.
DestinationPort uint16
}
TranslatedAddress describes NAT translation expected on a path. Each field is optional; an unset field means "no translation on that axis".
type VLAB ¶
type VLAB struct {
SSHKey string
VMs []VM
Nets []VLABNet
Passthroughs []string
Externals ExternalsCfg
}
type VLABAccessInfo ¶
type VLABAccessInfo struct {
SSHPort uint // local ssh port
SerialSock string
SerialLog string
IsSwitch bool // ssh through control node only
IsControl bool // Needed to distinguish VM type in show-tech
IsServer bool
IsNode bool // ssh through control node only
IsExternal bool
RemoteSerial string // ssh to get serial
}
type VLABAccessType ¶
type VLABAccessType string
const ( VLABAccessSSH VLABAccessType = "ssh" VLABAccessSCP VLABAccessType = "scp" VLABAccessSerial VLABAccessType = "serial" VLABAccessSerialLog VLABAccessType = "serial log" // ShowTechOutputDir is the default directory name for show-tech output ShowTechOutputDir = "show-tech-output" )
type VLABBuilder ¶
type VLABBuilderBase ¶ added in v0.44.0
type VLABBuilderBase struct {
// Helpers to build topologies based on non-default or mixed profiles
DefaultSwitchProfile string // default switch profile to use for switches
SwitchProfileOverrides map[string]string // switch profile overrides to use for switches
ServerPortBase string // base for server port interfaces (e.g. enp2s for ports like enp2s1, enp2s2, etc.)
NumberedLinks bool // annotate fabrics to hydrate fabric and mesh links with /31s instead of BGP unnumbered
// contains filtered or unexported fields
}
type VLABBuilderDefault ¶ added in v0.44.0
type VLABBuilderDefault struct {
SpinesCount uint8 // number of spines to generate
FabricLinksCount uint8 // number of links for each spine <> leaf pair
MeshLinksCount uint8 // number of mesh links for each leaf <> leaf pair
ESLAGLeafGroups string // eslag leaf groups - comma separated list of number of ESLAG switches in each group, should be 2-4 per group, e.g. 2,4,2 for 3 groups with 2, 4 and 2 switches
OrphanLeafsCount uint8 // number of non-MCLAG server-leafs to generate
ESLAGServers uint8 // number of ESLAG servers to generate for ESLAG switches
UnbundledServers uint8 // number of unbundled servers to generate for switches (only for one of the first switch in the redundancy group or orphan switch)
BundledServers uint8 // number of bundled servers to generate for switches (only for one of the second switch in the redundancy group or orphan switch)
MultiHomedServers uint8 // number of multi-homed servers (2 connections to 2 different leaves, preferably orphans)
NoSwitches bool // do not generate any switches
GatewayUplinks uint8 // number of uplinks for gateway node to the spines
GatewayDriver string // gateway driver to use for gateway node
GatewayWorkers uint8 // number of workers for gateway node
GatewayLogLevel string // initial log level for gateway
GatewayTags map[string]string // tracing targets for gateway
ExtBGPCount uint8 // number of BGP externals to generate
ExtStaticCount uint8 // number of static externals to generate (no proxy)
ExtStaticProxyCount uint8 // number of static externals to generate (with proxy)
ExtESLAGConnCount uint8 // number of external connections to generate from ESLAG leaves
ExtOrphanConnCount uint8 // number of external connections to generate from orphan leaves
ExtraDomain bool // add a second domain of as many spines, orphan leaves move to it (2 orphans by default)
ExtraFabric bool // generate a second fabric of two mesh leaves with a server each
InterconnectFabrics bool // connect a leaf of each fabric with an External on both sides
YesFlag bool
VLABBuilderBase
}
type VLABBuilderGPURail ¶ added in v0.44.0
type VLABBuilderGPURail struct {
ScalableUnits uint
VPCs uint
ServersPerVPCPerUnit uint
P2P bool
VLABBuilderBase
}
type VLABConfig ¶
type VLABConfig struct {
SSHKey string `json:"-"`
Sizes VMSizes `json:"sizes"`
VMs map[string]VMConfig `json:"vms"`
Externals ExternalsCfg `json:"externals"`
}
type VLABNet ¶ added in v0.51.0
type VLABNet struct {
Name string
Kind VLABNetKind
Taps int
// Queues has the queue count of each tap QEMU opens with more than one, the kernel refuses that unless it's
// created as a multi-queue tap
Queues map[int]int
// Ifaces are the host interfaces to add to the management network
Ifaces []string
}
VLABNet is a host network VMs attach to over the taps named after it, set up by the setup-vlab-net helper
func ParseVLABNet ¶ added in v0.51.0
type VLABNetKind ¶ added in v0.51.0
type VLABNetKind string
const ( // VLABNetKindMgmt is a bridge with the management taps and the host interfaces to reach hardware over VLABNetKindMgmt VLABNetKind = "mgmt" // VLABNetKindLink connects its two taps to each other as transparently as a cable would VLABNetKindLink VLABNetKind = "link" )
type VLABRunOpts ¶
type VLABRunOpts struct {
KillStale bool
ControlsRestricted bool
ServersRestricted bool
BuildMode recipe.BuildMode
AutoUpgrade bool
FailFast bool
OnReady []OnReady
OOBMgmtIface string
CollectShowTech bool
ForceCollectShowTech bool
VPCMode vpcapi.VPCMode
PauseOnFailure bool
ReleaseTestRegexes []string
ReleaseTestRegexesInvert bool
ReleaseTestOnReadyOnly bool
InterfaceMTU uint16
InspectPodsStrict bool
}
type VLABUpOpts ¶
type VLABUpOpts struct {
HydrateMode HydrateMode
NoCreate bool
ReCreate bool
BuildMode recipe.BuildMode
SetJoinToken string
ObservabilityTargets string
VMSizesOverrides VMSizes
VLABRunOpts
}
type VMConfig ¶
type VMConfig struct {
Type VMType `json:"type"`
SwitchMode VMSwitchMode `json:"switchMode,omitempty"`
SwitchProfile string `json:"switchProfile,omitempty"`
// Queues is the queue pairs of the gateway's NICs on links, taken from the wiring on each run and never saved, so
// the VLAB configs of other releases keep working for both of them
Queues uint8 `json:"-"`
NICs map[string]string `json:"nics"`
}
type VMSwitchMode ¶ added in v0.44.0
type VMSwitchMode string
const ( VMSwitchModeONIE VMSwitchMode = "" VMSwitchModeImage VMSwitchMode = "image" )
type VPCPeeringTestCtx ¶ added in v0.35.0
type VPCPeeringTestCtx struct {
// contains filtered or unexported fields
}
Source Files
¶
- cmdair.go
- cmdbench.go
- cmdbuild.go
- cmdcache.go
- cmdconfig.go
- cmddiagram.go
- cmdhelpers.go
- cmdhelpers_linux.go
- cmdvlab.go
- endpoints.go
- hydrate.go
- inspectpods.go
- matrix.go
- rt_acl_tests.go
- rt_base.go
- rt_eslag_fallback.go
- rt_gw_driver_toggle.go
- rt_gw_nat_acl_suite.go
- rt_gw_restart_tests.go
- rt_multi_vpc_multi_subnet_suite.go
- rt_multi_vpc_single_subnet_suite.go
- rt_nat_external_tests.go
- rt_nat_tests.go
- rt_no_vpc_suite.go
- rt_on_ready_suite.go
- rt_single_vpc_suite.go
- rt_static_external.go
- rt_utils.go
- testing.go
- tmplvalues.go
- upgradefrom.go
- vlabair.go
- vlabbuilder.go
- vlabconfig.go
- vlabhelpers.go
- vlabrunner.go
- vlabssh.go
Directories
¶
| Path | Synopsis |
|---|---|
|
Package bench generates and drives synthetic Fabric topologies against a running VLAB control node in order to find the scalability limits of the Fabric/Fabricator control plane.
|
Package bench generates and drives synthetic Fabric topologies against a running VLAB control node in order to find the scalability limits of the Fabric/Fabricator control plane. |