kubernetes-client / java

Official Java client library for kubernetes
http://kubernetes.io/
Apache License 2.0
3.47k stars 1.86k forks source link

Caused by: org.apache.http.conn.ConnectTimeoutException: Connect to service-name:80 [service-name/10.96.116.239] failed: connect timed out #2169

Closed I-want-to-knowledge closed 1 year ago

I-want-to-knowledge commented 2 years ago

Describe the bug

Service discovery error

Client Version

e.g. 13.0.2

Kubernetes Version

e.g. 1.20.+

Java Version

e.g. Java 11.0.5

To Reproduce

1---------------

spring-boot-starter-parent:2.6.4 spring-cloud-dependencies:2021.0.1 spring-boot-starter-web spring-cloud-starter-openfeign spring-boot-starter-actuator feign-httpclient (io.github.openfeign) spring-cloud-starter-kubernetes-client-all

2------------------

--Dockerfile-- ... java -Djdk.tls.client.protocols=TLSv1.2 -jar /*.jar ...

3------------------

image image image

Expected behavior

Can request 'caas-core-svc', @ feignclient when no URL is configured! Automatic service discovery!

KubeConfig

ordinary system

Server (please complete the following information):

Additional context

Or provide the implementation principle document of service discovery

I-want-to-knowledge commented 2 years ago

e.g. Java 11.0.11 is normal

I-want-to-knowledge commented 2 years ago

使用discoveryClient.getInstances("caas-core-svc")得到如下结果;

[KubernetesServiceInstance{instanceId='9f120881-4176-48b4-bcfc-678ae8f4a64d', serviceId='caas-core-svc', host='100.64.196.216', port=8080, uri=http://100.64.196.216:8080, secure=false, namespace=caas-system, cluster=null, metadata={null=8080, adp.aliyuncs.com/component-version=1.5.3-0, adp.aliyuncs.com/component-app-version=1.5.3, adp.aliyuncs.com/application-name=quota-test, adp.aliyuncs.com/component-name=aecp, adp.aliyuncs.com/component-type=aecp, adp.aliyuncs.com/application-namespace=default, adp.aliyuncs.com/component-namespace=acs-system, adp.aliyuncs.com/component-provider=}}]

image 其中key是null,Jackson解析是会报错,是不是这个原因导致的??

brendandburns commented 2 years ago

I don't think this is a client error. But more importantly this looks like it is running in a unit test?

We need much more detail on the environment and the stacktraces to see if there is a problem here in the client, but I suspect that there's a problem with your server.

k8s-triage-robot commented 2 years ago

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

This bot triages issues and PRs according to the following rules:

You can:

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

/lifecycle stale

k8s-triage-robot commented 2 years ago

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

This bot triages issues and PRs according to the following rules:

You can:

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

/lifecycle rotten

k8s-triage-robot commented 1 year ago

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

This bot triages issues and PRs according to the following rules:

You can:

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

/close

k8s-ci-robot commented 1 year ago

@k8s-triage-robot: Closing this issue.

In response to [this](https://github.com/kubernetes-client/java/issues/2169#issuecomment-1214240267): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues and PRs 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 or PR with `/reopen` >- Mark this issue or PR 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 > >[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/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.