diff --git a/extensions/kubernetes-client/deployment/src/test/java/io/quarkus/kubernetes/client/deployment/KubernetesClientCDITest.java b/extensions/kubernetes-client/deployment/src/test/java/io/quarkus/kubernetes/client/deployment/KubernetesClientCDITest.java
new file mode 100644
index 0000000000000..d9202ab71d5ba
--- /dev/null
+++ b/extensions/kubernetes-client/deployment/src/test/java/io/quarkus/kubernetes/client/deployment/KubernetesClientCDITest.java
@@ -0,0 +1,40 @@
+package io.quarkus.kubernetes.client.deployment;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import jakarta.inject.Inject;
+import jakarta.inject.Singleton;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+
+import io.fabric8.kubernetes.client.Config;
+import io.fabric8.kubernetes.client.KubernetesClient;
+import io.quarkus.kubernetes.client.KubernetesConfigCustomizer;
+import io.quarkus.test.QuarkusUnitTest;
+
+public class KubernetesClientCDITest {
+
+ @Inject
+ KubernetesClient client;
+
+ @Test
+ public void test() {
+ assertEquals("-1", client.getConfiguration().getApiVersion());
+ }
+
+ @RegisterExtension
+ static QuarkusUnitTest runner = new QuarkusUnitTest()
+ .withApplicationRoot((jar) -> jar
+ .addClasses(Customizer.class))
+ .overrideConfigKey("quarkus.kubernetes-client.devservices.enabled", "false");
+
+ @Singleton
+ public static class Customizer implements KubernetesConfigCustomizer {
+ @Override
+ public void customize(Config config) {
+ config.setApiVersion("-1");
+ }
+ }
+
+}
diff --git a/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/KubernetesConfigCustomizer.java b/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/KubernetesConfigCustomizer.java
new file mode 100644
index 0000000000000..1ff0a573bfe7c
--- /dev/null
+++ b/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/KubernetesConfigCustomizer.java
@@ -0,0 +1,25 @@
+package io.quarkus.kubernetes.client;
+
+import java.util.List;
+
+import io.fabric8.kubernetes.client.Config;
+import io.fabric8.kubernetes.client.KubernetesClient;
+import io.quarkus.kubernetes.client.runtime.KubernetesClientBuildConfig;
+import io.quarkus.kubernetes.client.runtime.KubernetesClientProducer;
+import io.quarkus.kubernetes.client.runtime.KubernetesConfigProducer;
+import io.quarkus.runtime.TlsConfig;
+
+/**
+ * Meant to be implemented by a CDI bean that provided arbitrary customization for the default {@link Config} created by
+ * Quarkus.
+ *
+ * The {@link Config} is in turn used to produce the default {@link KubernetesClient}
+ *
+ *
+ * @see KubernetesConfigProducer#config(KubernetesClientBuildConfig, TlsConfig, List) }
+ * @see KubernetesClientProducer#kubernetesClient(Config) }
+ */
+public interface KubernetesConfigCustomizer {
+
+ void customize(Config config);
+}
diff --git a/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/runtime/KubernetesConfigProducer.java b/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/runtime/KubernetesConfigProducer.java
index 8c9bf33a70da1..468f092ea28a1 100644
--- a/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/runtime/KubernetesConfigProducer.java
+++ b/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/runtime/KubernetesConfigProducer.java
@@ -1,10 +1,14 @@
package io.quarkus.kubernetes.client.runtime;
+import java.util.List;
+
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Singleton;
import io.fabric8.kubernetes.client.Config;
+import io.quarkus.arc.All;
import io.quarkus.arc.DefaultBean;
+import io.quarkus.kubernetes.client.KubernetesConfigCustomizer;
import io.quarkus.runtime.TlsConfig;
@Singleton
@@ -13,7 +17,13 @@ public class KubernetesConfigProducer {
@DefaultBean
@Singleton
@Produces
- public Config config(KubernetesClientBuildConfig buildConfig, TlsConfig tlsConfig) {
- return KubernetesClientUtils.createConfig(buildConfig, tlsConfig);
+ public Config config(KubernetesClientBuildConfig buildConfig,
+ TlsConfig tlsConfig,
+ @All List customizers) {
+ var result = KubernetesClientUtils.createConfig(buildConfig, tlsConfig);
+ for (KubernetesConfigCustomizer customizer : customizers) {
+ customizer.customize(result);
+ }
+ return result;
}
}