Skip to content

test/e2e: wait for API server DNS before using new cluster - #880

Open
e5z26 wants to merge 1 commit into
aws:mainfrom
e5z26:fix/e2e-wait-apiserver-dns
Open

e5z26 wants to merge 1 commit into
aws:mainfrom
e5z26:fix/e2e-wait-apiserver-dns

Conversation

@e5z26

@e5z26 e5z26 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Issue #, if available:

N/A

Description of changes:

An EKS cluster can report ACTIVE before the DNS record for its API server endpoint resolves. E2E setup creates the pod identity service account right after the cluster becomes ACTIVE. When the endpoint doesn't resolve yet, the request fails with no such host, and the existing retry gives up after about 30 seconds:

creating service account pod-identity-sa in namespace default: timed out waiting for the condition while retrying: Post "https://<id>.gr7.us-west-2.eks.amazonaws.com/api/v1/namespaces/default/serviceaccounts": dial tcp: lookup <id>.gr7.us-west-2.eks.amazonaws.com on 172.31.0.2:53: no such host

This change makes hybridCluster.create() wait until the API server hostname resolves before it returns. It polls every 10s, for up to 10 minutes. Every caller of create() therefore gets a cluster whose endpoint can be reached, instead of each Kubernetes call needing its own DNS retries.

Testing (if applicable):

  • Added unit tests for waitForAPIServerDNS:
    • a resolvable host (localhost)
    • a host that never resolves (.invalid, reserved by RFC 6761), which times out with an error naming the host
    • an endpoint with no hostname
  • go build ./... and go vet ./test/e2e/... pass.
  • The race happens in roughly 1 in 75 runs, so a single e2e run can't show the fix. Successful runs now log Waiting for API server endpoint to resolve followed by API server endpoint resolved.

Documentation added/planned (if applicable):

N/A

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant