eclipse-vertx / eclipse-vertx/vert.x

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

Open
#5,484 7 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
Java
Stars
14.7k
Forks
2.1k
Avg merge
2d 7h
Merged PRs (30d)
28

Description

[kubernetes-client-vertx.zip](https://github.com/user-attachments/files/18822071/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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.