Skip to content

add e2e test for locality aware load balancer #1278

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

harish2773
Copy link

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

@kmesh-bot
Copy link
Collaborator

[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
Copy link
Collaborator

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


This test verifies that Kmesh correctly routes traffic to the nearest available instance
based on locality (region, zone, and subzone). The test performs the following steps:
1. Create a Kind cluster with three worker nodes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to test in an existing E2E cluster ranther than creating a new Kind cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants