Skip to content

CluserLoader2 run-e2e.sh connects to unexpected clusters when more than single cluster is available in the KUBECONFIG #3625

@jprzychodzen

Description

@jprzychodzen

What happened:
Running CL2 locally with the run-e2e.sh script can unexpectedly fail when it attempts to connect to the wrong API server.

How to reproduce it (as minimally and precisely as possible):

  1. Add multiple clusters to your KUBECONFIG file.
  2. Ensure that the target test cluster is not the first entry in the KUBECONFIG.
  3. Use the run-e2e.sh wrapper to run CL2.

Anything else we need to know?:
The current logic: server=$(kubectl --kubeconfig "${KUBECONFIG}" config view -o jsonpath='{.clusters[0].cluster.server}') always points to the first cluster listed in the KUBECONFIG file.

If there are multiple entries, the script may select connection information from a mismatching entry, effectively breaking connectivity in local development environments. This issue is not visible in K8s CI tests, as those jobs are short-lived and always use a KUBECONFIG file with a single entry.

Workaround:
For scale testing with CL2, create a KUBECONFIG file containing only a single entry pointing to the specific test cluster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions