longrunningcluster

package
v1.7.13 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoLowNICNodes            = errors.New("no low-NIC nodes available")
	ErrNoHighNICNodes           = errors.New("no high-NIC nodes available")
	ErrAllLowNICNodesInUse      = errors.New("all low-NIC nodes already in use")
	ErrAllHighNICNodesInUse     = errors.New("all high-NIC nodes already in use")
	ErrFailedToGenerateSASToken = errors.New("failed to generate SAS token")
	ErrSASTokenEmpty            = errors.New("generated SAS token is empty")
	ErrSASTokenInvalid          = errors.New("generated SAS token appears invalid")
	ErrPodNotRunning            = errors.New("pod is not running")
	ErrHTTPAuthError            = errors.New("HTTP authentication error from private endpoint")
	ErrBlobNotFound             = errors.New("blob not found (404) on private endpoint")
	ErrUnexpectedBlobResponse   = errors.New("unexpected response from blob download (no 'Hello' or '200 OK' found)")
	ErrInvalidWorkloadType      = errors.New("invalid workload type")
	ErrUnexpectedTCPResponse    = errors.New("unexpected TCP response")
)

Functions

func CreateAllScenarios

func CreateAllScenarios(testScenarios TestScenarios) error

func CreateNamespaceResource

func CreateNamespaceResource(kubeconfig, namespace string) error

func CreatePod

func CreatePod(kubeconfig string, data PodData, templatePath string) error

func CreatePodNetwork

func CreatePodNetwork(kubeconfig string, data PodNetworkData, templatePath string) error

func CreatePodNetworkInstance

func CreatePodNetworkInstance(kubeconfig string, data PNIData, templatePath string) error

func CreatePodNetworkInstanceResource

func CreatePodNetworkInstanceResource(resources TestResources) error

func CreatePodNetworkResource

func CreatePodNetworkResource(resources TestResources) error

func CreatePodResource

func CreatePodResource(resources TestResources, podName, nodeName string) error

func CreateScenarioResources

func CreateScenarioResources(scenario PodScenario, testScenarios TestScenarios) error

func DeleteAllScenarios

func DeleteAllScenarios(testScenarios TestScenarios) error

func DeleteScenarioResources

func DeleteScenarioResources(scenario PodScenario, buildID string) error

func DeleteTestResources

func DeleteTestResources(kubeconfig, pnName, pniName string) error

func ExecInPodWithTimeout

func ExecInPodWithTimeout(kubeconfig, namespace, podName, command string, timeout time.Duration) (string, error)

func GenerateStorageSASToken

func GenerateStorageSASToken(storageAccountName, containerName, blobName string) (string, error)

func GetStoragePrivateEndpoint

func GetStoragePrivateEndpoint(storageAccountName string) (string, error)

func RunConnectivityTest

func RunConnectivityTest(test ConnectivityTest) error

RunConnectivityTest tests TCP connectivity between two pods using netcat

func RunPrivateEndpointTest

func RunPrivateEndpointTest(test ConnectivityTest) error

Types

type ConnectivityTest

type ConnectivityTest struct {
	Name            string
	SourcePod       string
	SourceNamespace string // Namespace of the source pod
	DestinationPod  string
	DestNamespace   string // Namespace of the destination pod
	Cluster         string // Cluster where source pod is running (for backward compatibility)
	DestCluster     string // Cluster where destination pod is running (if different from source)
	Description     string
	ShouldFail      bool // If true, connectivity is expected to fail (NSG block, customer isolation)

	// Fields for private endpoint tests
	SourceCluster string // Cluster where source pod is running
	SourcePodName string // Name of the source pod
	SourceNS      string // Namespace of the source pod
	DestEndpoint  string // Destination endpoint (IP or hostname)
	TestType      string // Type of test: "pod-to-pod" or "storage-access"
	Purpose       string // Description of the test purpose
}

ConnectivityTest defines a connectivity test between two pods

type NodePoolInfo

type NodePoolInfo struct {
	LowNicNodes  []string
	HighNicNodes []string
}

func GetNodesByNicCount

func GetNodesByNicCount(kubeconfig string) (NodePoolInfo, error)

type PNIData

type PNIData struct {
	PNIName      string
	PNName       string
	Namespace    string
	Reservations int
}

type PodData

type PodData struct {
	PodName   string
	NodeName  string
	OS        string
	PNName    string
	PNIName   string
	Namespace string
	Image     string
}

type PodNetworkData

type PodNetworkData struct {
	PNName      string
	VnetGUID    string
	SubnetGUID  string
	SubnetARMID string
	SubnetToken string
}

type PodScenario

type PodScenario struct {
	Name          string // Descriptive name for the scenario
	Cluster       string // "aks-1" or "aks-2"
	VnetName      string // e.g., "cx_vnet_v1", "cx_vnet_v4"
	SubnetName    string // e.g., "s1", "s2"
	NodeSelector  string // "low-nic" or "high-nic"
	PodNameSuffix string // Unique suffix for pod name
}

type TestResources

type TestResources struct {
	Kubeconfig         string
	PNName             string
	PNIName            string
	VnetGUID           string
	SubnetGUID         string
	SubnetARMID        string
	SubnetToken        string
	PodNetworkTemplate string
	PNITemplate        string
	PodTemplate        string
	PodImage           string
	Reservations       int
	Namespace          string
}

type TestScenarios

type TestScenarios struct {
	ResourceGroup   string
	BuildID         string
	PodImage        string
	Scenarios       []PodScenario
	VnetSubnetCache map[string]VnetSubnetInfo
	UsedNodes       map[string]bool
}

type VnetSubnetInfo

type VnetSubnetInfo struct {
	VnetGUID    string
	SubnetGUID  string
	SubnetARMID string
	SubnetToken string
}

func GetOrFetchVnetSubnetInfo

func GetOrFetchVnetSubnetInfo(rg, vnetName, subnetName string, cache map[string]VnetSubnetInfo) (VnetSubnetInfo, error)

Jump to

Keyboard shortcuts

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