<p>Recently I got this warning message, when I have builded <code>quarkus maven</code> project. I have tested with several later versions and I think this has to be something local in my environment.</p>
<pre><code>[WARNING] Error reading service account token from: [/var/run/secrets/kubernetes.io/serviceaccount/token]. Ignoring
</code></pre>
<p>And this result in a build failure ...</p>
<pre><code>[error]: Build step io.quarkus.kubernetes.deployment.KubernetesDeployer#deploy threw an exception: java.lang.RuntimeException: 
</code></pre>
<p>Although Kubernetes deployment was requested, it however cannot take place, because there was an error during communication with the API Server at <code>https://kubernetes.default.svc/</code></p>
<p>Any ideas what could be wrong?</p>

<p>Like <a href="https://stackoverflow.com/users/11023331/tapani-rundgren">Tapani Rundgren</a> mentioned in the comments, the solution is to export the variables:</p>
<pre><code>export KUBERNETES_MASTER=&lt;your server here&gt;
export KUBERNETES_NAMESPACE=&lt;your namspace here&gt;
</code></pre>
