Skip to content

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

Open
@iampratapak

Description

@iampratapak

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

fabric8io/kubernetes-client#6868

Our application is based on helidon SE 4.1.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions