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

贡献者指南