add e2e test for locality aware load balancer
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:
-
Namespace Setup:
- A separate namespace (
sample) is created to isolate the test environment.
- A separate namespace (
-
Application Deployment:
- Three instances of the
helloworldapplication are deployed on different nodes to simulate locality-based traffic handling:- Local Instance: Deployed on
ambient-workerwith the versionregion.zone1.subzone1. - Remote Instance 1: Deployed on
ambient-worker2with the versionregion.zone1.subzone2. - Remote Instance 2: Deployed on
ambient-worker3with the versionregion.zone2.subzone3.
- Local Instance: Deployed on
- Three instances of the
-
Client Setup:
- A
sleepclient is deployed onambient-workerto generate test requests.
- A
-
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).
- Initially, the sleep client’s request (using
- The test verifies the following:
-
Cleanup:
- All test resources (namespace, deployments, and services) are deleted after the test completes.
Does this PR introduce a user-facing change?:
NONE
[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.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Welcome @harish2773! It looks like this is your first PR to kmesh-net/kmesh 🎉