<p>I'm trying to deploy a Quarkus app to a Kubernetes cluster, but I got the following stacktrace:</p>
<pre><code>exec java -Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -XX:+ExitOnOutOfMemoryError -cp . -jar /deployments/quarkus-run.jar
__  ____  __  _____   ___  __ ____  ______ 
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,&lt; / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-05-11 16:47:19,455 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.NumberFormatException: SRCFG00029: Expected an integer value, got &quot;tcp://10.233.12.82:80&quot;
    at io.smallrye.config.Converters.lambda$static$60db1e39$1(Converters.java:104)
    at io.smallrye.config.Converters$EmptyValueConverter.convert(Converters.java:949)
    at io.smallrye.config.Converters$TrimmingConverter.convert(Converters.java:970)
    at io.smallrye.config.Converters$BuiltInConverter.convert(Converters.java:872)
    at io.smallrye.config.Converters$OptionalConverter.convert(Converters.java:790)
    at io.smallrye.config.Converters$OptionalConverter.convert(Converters.java:771)
    at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:225)
    at io.smallrye.config.SmallRyeConfig.getOptionalValue(SmallRyeConfig.java:270)
    at io.quarkus.arc.runtime.ConfigRecorder.validateConfigProperties(ConfigRecorder.java:37)
    at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties1249763973.deploy_0(ConfigBuildStep$validateConfigProperties1249763973.zig:328)
    at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties1249763973.deploy(ConfigBuildStep$validateConfigProperties1249763973.zig:40)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:576)
    at io.quarkus.runtime.Application.start(Application.java:90)
    at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:100)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:66)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
    at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:48)
    at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:25)
</code></pre>
<p>I build the Docker image with the <a href="https://github.com/quarkusio/quarkus-quickstarts/blob/main/getting-started/src/main/docker/Dockerfile.jvm" rel="nofollow noreferrer">default dockerfile</a>, and my quarkus-related dependencies are the following:</p>
<pre class="lang-kotlin prettyprint-override"><code>dependencies {
    implementation(enforcedPlatform(&quot;${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}&quot;))
    implementation(&quot;org.optaplanner:optaplanner-quarkus&quot;)
    implementation(&quot;io.quarkus:quarkus-resteasy&quot;)
    implementation(&quot;io.quarkus:quarkus-vertx&quot;)
    implementation(&quot;io.quarkus:quarkus-resteasy-jackson&quot;)
    implementation(&quot;io.quarkus:quarkus-undertow-websockets&quot;)
    implementation(&quot;io.quarkus:quarkus-smallrye-health&quot;)
}
</code></pre>
<p>I'm using Quarkus 1.13.3.Final, and I've written a helm chart for my deployment by hand. The deployed dockerfile runs fine on my machine, and the kubernetes deployment descriptor does not have that IP address in it. I think that IP is a ClusterIP of the cluster.</p>
<p>Any idea? Thanks</p>

<p>It's due to the <a href="https://github.com/kubernetes/kubernetes/blob/v1.20.0/pkg/kubelet/envvars/envvars.go#L87-L90" rel="noreferrer">docker link variables</a> that kubernetes mimics for <code>Service</code> names in scope; it bites people a lot when they have generically named services such as <code>{ apiVersion: v1, kind: Service, metadata: { name: http }, ...</code> as it will cheerfully produce environment variables of the form <code>HTTP_PORT=tcp://10.233.12.82:80</code> in the Pod, and things such as Spring boot or evidently Quarkus which coerce env-vars into configuration overrides can cause the exact outcome you're experiencing</p>
<p>The solution is (a) don't name <code>Services</code> with bland names (b) &quot;mask off&quot; the offensive env-vars for the Pod:</p>
<pre class="lang-yaml prettyprint-override"><code>...
  containers:
  - ...
    env:
    - name: HTTP_PORT
    # it doesn't need a value:, it just needs the name to be specified
    # so it hides the injected version
    - ... any remaining env-vars you really want
</code></pre>
