kubernetes-client / javascript

Javascript client
Apache License 2.0
2.04k stars 519 forks source link

API Server host is resolved to its ipv6 and not to its ipv4 #1661

Closed jobcespedes closed 1 month ago

jobcespedes commented 6 months ago

Describe the bug The client tries to connect to the API Server and fails. In EKS with IPv6, API Server is only available in its IPv4 address. However, the client does not seem to fallback to the API Server ipv4. The error is:

request to https://somenumber.gr7.us-east-1.eks.amazonaws.com/apis/lms.krestomat.io/v1alpha1/lmsmoodles failed, reason: connect ETIMEDOUT 64:ff9b::a00:911c:443

Client Version 1.0.0-rc4

Server Version 1.29.3

To Reproduce

Expected behavior IPv4 is use if IPv6 is not accesible. Or at least it can be configured to use ipv4 resolution

Environment (please complete the following information):

brendandburns commented 6 months ago

I don't think that this is inside this client.

jobcespedes commented 6 months ago

You might be right. It seemed like an infra issue in EKS. Nonetheless, some troubleshooting findings suggested it was the client or node server: I used curl to make a request to the API Server endpoint in the same container node server and the client are running. With verbose output, it resolved to IPv6 and then IPv4 address and the request was successful. However, using explicit resolve option with the IPv6 address, curl also timeout. However, the error message reported above by the function calling the client seems to indicate the client is only trying the IPv6 address of the API server. Unfortunately, EKS API server does not work with its ipv6 address, despite one being assigned.

jobcespedes commented 6 months ago

Currently lookin at node option autoSelectFamily: true from https://nodejs.org/docs/latest-v18.x/api/net.html#socketconnectoptions-connectlistener; or --dns-result-order=ipv4first

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 2 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 1 month ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-client/javascript/issues/1661#issuecomment-2354993832): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.