-
Notifications
You must be signed in to change notification settings - Fork 1.6k
E2E infra improvements + Maglev E2E code improvements: #12477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -40,21 +40,27 @@ import ( | |||||
| "github.com/projectcalico/calico/e2e/pkg/utils" | ||||||
| "github.com/projectcalico/calico/e2e/pkg/utils/conncheck" | ||||||
| "github.com/projectcalico/calico/e2e/pkg/utils/externalnode" | ||||||
| "github.com/projectcalico/calico/e2e/pkg/utils/format" | ||||||
| "github.com/projectcalico/calico/e2e/pkg/utils/images" | ||||||
| ) | ||||||
|
|
||||||
| // DESCRIPTION: This test verifies the operation of Maglev load balancing algorithm. | ||||||
|
|
||||||
| // TODO: | ||||||
| // DOCS_URL: | ||||||
| // PRECONDITIONS: Enterprise v3.xx or later; OSS v3.xx or later | ||||||
| // PRECONDITIONS: Enterprise v3.23 or later; OSS v3.32 or later | ||||||
|
|
||||||
| func init() { | ||||||
| format.RegisterExitErrorFormatter() | ||||||
| } | ||||||
|
|
||||||
| var _ = describe.CalicoDescribe( | ||||||
| describe.WithTeam(describe.Core), | ||||||
| describe.WithFeature("Maglev"), | ||||||
| describe.WithCategory(describe.Networking), | ||||||
| describe.WithExternalNode(), | ||||||
| describe.WithDataplane(describe.BPF), | ||||||
| describe.WithSerial(), | ||||||
| describe.WithAWS(), | ||||||
| "Maglev load balancing tests", | ||||||
| func() { | ||||||
|
|
@@ -76,7 +82,7 @@ var _ = describe.CalicoDescribe( | |||||
| ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second) | ||||||
| defer cancel() | ||||||
| nodes, err := e2enode.GetBoundedReadySchedulableNodes(ctx, f.ClientSet, 10) // Get up to 10 nodes | ||||||
| Expect(err).ShouldNot(HaveOccurred()) | ||||||
| Expect(err).ShouldNot(HaveOccurred(), "Failed to get schedulable nodes") | ||||||
| if len(nodes.Items) == 0 { | ||||||
| Fail("No schedulable nodes exist, can't continue test.") | ||||||
| } | ||||||
|
|
@@ -85,7 +91,7 @@ var _ = describe.CalicoDescribe( | |||||
| nodeNames = nodesInfo.GetNames() | ||||||
| nodeIPv4s := nodesInfo.GetIPv4s() | ||||||
| nodeIPv6s := nodesInfo.GetIPv6s() | ||||||
| Expect(len(nodeNames)).Should(BeNumerically(">", 0)) | ||||||
| Expect(len(nodeNames)).Should(BeNumerically(">", 0), "Expected at least one schedulable node") | ||||||
| framework.Logf("Found %d nodes for testing: %v", len(nodeNames), nodeNames) | ||||||
|
|
||||||
| // Initialize the test helper | ||||||
|
|
@@ -113,20 +119,12 @@ var _ = describe.CalicoDescribe( | |||||
| ipVer = "IPv6" | ||||||
| } | ||||||
| return func() { | ||||||
| if isIPv6 { | ||||||
| if len(maglevTests.nodeNameToIPv6) == 0 { | ||||||
| Skip("IPv6 is not configured, skipping IPv6 Maglev test") | ||||||
| } | ||||||
| } else { | ||||||
| if len(maglevTests.nodeNameToIPv4) == 0 { | ||||||
| Skip("IPv4 is not configured, skipping IPv4 Maglev test") | ||||||
| } | ||||||
| } | ||||||
| maglevTests.SkipUnsupportedIPVersions(isIPv6) | ||||||
| // Ensure we have at least 3 nodes for the test | ||||||
| Expect(len(nodeNames)).Should(BeNumerically(">=", 3), "Need at least 3 nodes for this test") | ||||||
|
|
||||||
| // Deploy 20 backend pods on node 1 (first node) | ||||||
| maglevTests.DeployBackendPods(20, []string{nodeNames[0]}) | ||||||
| _ = maglevTests.DeployBackendPods(20, []string{nodeNames[0]}) | ||||||
| // Deploy service "netexec" backed by the 20 pods | ||||||
| maglevTests.DeployService() | ||||||
| // Add route to external node where packets to service cluster IP go to node 2 | ||||||
|
|
@@ -192,14 +190,13 @@ var _ = describe.CalicoDescribe( | |||||
| }) | ||||||
|
|
||||||
| type MaglevTests struct { | ||||||
| f *framework.Framework | ||||||
| serviceClusterIPv4 string | ||||||
| serviceClusterIPv6 string | ||||||
| loadBalancerService *v1.Service | ||||||
| maglevConfig *MaglevConfig | ||||||
| nodeNameToIPv4 map[string]string | ||||||
| nodeNameToIPv6 map[string]string | ||||||
| connTester conncheck.ConnectionTester | ||||||
| f *framework.Framework | ||||||
| serviceClusterIPv4 string | ||||||
| serviceClusterIPv6 string | ||||||
| maglevConfig *MaglevConfig | ||||||
| nodeNameToIPv4 map[string]string | ||||||
| nodeNameToIPv6 map[string]string | ||||||
| connTester conncheck.ConnectionTester | ||||||
| } | ||||||
|
|
||||||
| type MaglevConfig struct { | ||||||
|
|
@@ -240,6 +237,8 @@ func (m *MaglevTests) IPFamilies() []v1.IPFamily { | |||||
| return families | ||||||
| } | ||||||
|
|
||||||
| var backendPodPattern = regexp.MustCompile(`^backend-pod-\d+$`) | ||||||
|
|
||||||
| // parseBackendResponse parses the JSON response from netexec and returns the backend pod name | ||||||
| func (m *MaglevTests) parseBackendResponse(output string) (string, error) { | ||||||
| // NetexecResponse represents the JSON response from the netexec service | ||||||
|
|
@@ -256,25 +255,40 @@ func (m *MaglevTests) parseBackendResponse(output string) (string, error) { | |||||
| backendName := strings.TrimSpace(response.Output) | ||||||
|
|
||||||
| // Verify this matches our expected backend pod naming pattern (backend-pod-0 to backend-pod-19) | ||||||
|
||||||
| // Verify this matches our expected backend pod naming pattern (backend-pod-0 to backend-pod-19) | |
| // Verify this matches our expected backend pod naming pattern (backend-pod-N). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOCKER_RUN_CGOforcesCGO_ENABLED=1with libbpf flags unconditionally. That will likely break e2e builds on arches where Felix disables CGO/libbpf (Felix gates toamd64 arm64 ppc64le). Suggest adding similarifeqgating here so non-supportedARCHvalues fall back to the non-CGO build path and don't depend on$(LIBBPF_A).