eclipse-vertx/vert.x

Issue with GraalVM Native Image Unable to Connect to Kubernetes API Server

開放

#5,484 建立於 2025年2月17日

 (7 則留言) (0 個反應) (0 位負責人)Java (2,041 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (14,025 顆星)
PR 合併指標
 (平均合併 9天 15小時) (30 天內合併 45 個 PR)

描述

kubernetes-client-vertx.zip

Questions

When using Vert.x instead of OkHttp with the Kubernetes client, the connection to the Kubernetes API server fails.

Version

vertx: 4.5.12

java 23.0.2 2025-01-21
Java(TM) SE Runtime Environment Oracle GraalVM 23.0.2+7.1 (build 23.0.2+7-jvmci-b01)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 23.0.2+7.1 (build 23.0.2+7-jvmci-b01, mixed mode, sharing)

Context

In our application, we use the Fabric8 Kubernetes client to connect to the Kubernetes API server. Recently, we upgraded to Kubernetes client version 7.1.0, which uses Vert.x by default instead of OkHttp.

When I generate a native image for the application and run it in the Kubernetes cluster, I encounter the error below. However, the regular JAR image runs without any issues.

Do you have a reproducer?

I've attached a sample reproducer here.

Error:

Exception in thread "main" io.fabric8.kubernetes.client.KubernetesClientException: The timeout of 10000 ms has been exceeded when getting a connection to 10.96.0.1:443
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.waitForResult(OperationSupport.java:509)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.list(BaseOperation.java:451)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.list(BaseOperation.java:419)
	at io.fabric8.kubernetes.client.dsl.internal.BaseOperation.list(BaseOperation.java:98)
	at com.oracle.cx.vertical.communications.kubernetes.client.vertx.Main.testKubernetesClientVertx(Main.java:72)
	at com.oracle.cx.vertical.communications.kubernetes.client.vertx.Main.main(Main.java:41)
	at java.base@23.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: io.vertx.core.impl.NoStackTraceTimeoutException: The timeout of 10000 ms has been exceeded when getting a connection to 10.96.0.1:443

Reference Issue in Fabric8

https://github.com/fabric8io/kubernetes-client/issues/6868

Our application is based on helidon SE 4.1.6

貢獻者指南