I'm following examples from https://vertx.io/docs/vertx-config/java/#_kubernetes_configmap_store and trying to read configuration from config map. Unfortunately I'm facing following issue while trying:
SEVERE: Error while scanning configuration io.vertx.core.file.FileSystemException: java.nio.file.NoSuchFileException: /var/run/secrets/kubernetes.io/serviceaccount/token at io.vertx.core.file.impl.FileSystemImpl$16.perform(FileSystemImpl.java:869) at io.vertx.core.file.impl.FileSystemImpl$16.perform(FileSystemImpl.java:861) at io.vertx.core.file.impl.FileSystemImpl$BlockingAction.handle(FileSystemImpl.java:974) at io.vertx.core.file.impl.FileSystemImpl$BlockingAction.handle(FileSystemImpl.java:955) at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$2(ContextImpl.java:316) at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.nio.file.NoSuchFileException: /var/run/secrets/kubernetes.io/serviceaccount/token at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116) at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:215) at java.base/java.nio.file.Files.newByteChannel(Files.java:370) at java.base/java.nio.file.Files.newByteChannel(Files.java:421) at java.base/java.nio.file.Files.readAllBytes(Files.java:3205) at io.vertx.core.file.impl.FileSystemImpl$16.perform(FileSystemImpl.java:865) ... 9 more
I'm trying to read either from minikube or remote Kubernetes cluster via settin up KUBECONFIG env.
It occured that I need to specify token
key, like
ConfigStoreOptions kubernetesStore = new ConfigStoreOptions()
.setType("configmap")
.setConfig(new JsonObject()
.put("optional", false)
.put("token", "some-token")
.put("key", "data")
.put("name", "metaname")
);
But then I do face this:
SEVERE: Error while scanning configuration java.lang.NullPointerException: no null host accepted at java.base/java.util.Objects.requireNonNull(Objects.java:246) at io.vertx.core.http.impl.HttpClientImpl.createRequest(HttpClientImpl.java:1080) at io.vertx.core.http.impl.HttpClientImpl.createRequest(HttpClientImpl.java:1074) at io.vertx.core.http.impl.HttpClientImpl.request(HttpClientImpl.java:591) at io.vertx.ext.web.client.impl.HttpContext.handlePrepareRequest(HttpContext.java:339) at io.vertx.ext.web.client.impl.HttpContext.execute(HttpContext.java:283) at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:270) at io.vertx.ext.web.client.impl.predicate.PredicateInterceptor.handle(PredicateInterceptor.java:69) at io.vertx.ext.web.client.impl.predicate.PredicateInterceptor.handle(PredicateInterceptor.java:32) at io.vertx.ext.web.client.impl.HttpContext.next(HttpContext.java:267) at io.vertx.ext.web.client.impl.HttpContext.fire(HttpContext.java:277) at io.vertx.ext.web.client.impl.HttpContext.prepareRequest(HttpContext.java:166) at io.vertx.ext.web.client.impl.HttpRequestImpl.send(HttpRequestImpl.java:290) at io.vertx.ext.web.client.impl.HttpRequestImpl.send(HttpRequestImpl.java:260) at io.vertx.config.kubernetes.ConfigMapStore.lambda$getOnContext$4(ConfigMapStore.java:192) at io.vertx.core.Future.lambda$compose$1(Future.java:291) at io.vertx.core.impl.SucceededFuture.setHandler(SucceededFuture.java:41) at io.vertx.core.Future.compose(Future.java:287) at io.vertx.config.kubernetes.ConfigMapStore.getOnContext(ConfigMapStore.java:176) at io.vertx.config.kubernetes.ConfigMapStore.lambda$get$2(ConfigMapStore.java:164) at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:369) at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:416) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:515) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) at java.base/java.lang.Thread.run(Thread.java:834)
My question is if I'm missing something, or usage suggested by docs lacks some information? Fabric8 Kubernetes client works fine on my machine.
Thank you in advance.