kmesh icon indicating copy to clipboard operation
kmesh copied to clipboard

add e2e test for locality aware load balancer

Open dendwho opened this issue 9 months ago • 2 comments

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR adds an end-to-end test for Locality-Aware Load Balancing. It verifies that service traffic is correctly routed to instances in the nearest locality based on region/zone/subzone topology.

Which issue(s) this PR fixes:
Contributes towards #1146

Test Steps:

  1. Namespace Setup:

    • A separate namespace (sample) is created to isolate the test environment.
  2. Application Deployment:

    • Three instances of the helloworld application are deployed on different nodes to simulate locality-based traffic handling:
      • Local Instance: Deployed on ambient-worker with the version region.zone1.subzone1.
      • Remote Instance 1: Deployed on ambient-worker2 with the version region.zone1.subzone2.
      • Remote Instance 2: Deployed on ambient-worker3 with the version region.zone2.subzone3.
  3. Client Setup:

    • A sleep client is deployed on ambient-worker to generate test requests.
  4. Validation:

    • The test verifies the following:
      • Initially, the sleep client’s request (using curl) is handled by the local instance (region.zone1.subzone1).
      • After terminating the local instance, the test ensures that traffic shifts to the nearest available instance based on locality (either remote instance 1 or 2).
  5. Cleanup:

    • All test resources (namespace, deployments, and services) are deleted after the test completes.

Does this PR introduce a user-facing change?:
NONE

dendwho avatar Mar 15 '25 11:03 dendwho

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

kmesh-bot avatar Mar 15 '25 11:03 kmesh-bot

Welcome @harish2773! It looks like this is your first PR to kmesh-net/kmesh 🎉

kmesh-bot avatar Mar 15 '25 11:03 kmesh-bot