<p>How to have the properties of Quarkus <code>application.properties</code> be available as configmap or environment variable in the Kubernetes container?</p>
<p>The quarkus provides helm and kubernetes extensions to generate resources (yaml) during the build, which can be used to deploy the application in kubernetes. However this extension does not elaborate the ways to generate the configmap to hold the application properties set in the <code>application.properties</code>. The site too does not give directions on it.</p>

vvra
<p>This is the purpose of the <a href="https://quarkus.io/guides/kubernetes-config" rel="nofollow noreferrer">Kubernetes Config</a> extension. Basically, after adding the Kubernetes Config, Kubernetes, and Helm extensions to your Maven/Gradle configuration, you need first to enable it by adding the following properties to your application properties:</p>
<pre><code>quarkus.kubernetes-config.enabled=true
quarkus.kubernetes-config.config-maps=app-config
</code></pre>
<p>With these two properties, Quarkus will try to load the config map named <code>app-config</code> at startup as config source.</p>
<p>Where is the ConfigMap named <code>app-config</code>? You need to write it on your own and write the application properties there, for example:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  application.properties: |
    hello.message=Hello %s from configmap
</code></pre>
<p>and then add the content at the file <code>src/main/kubernetes/kubernetes.yml</code>. (Note that the name of the file must be <code>kubernetes.yml</code> and the folder <code>src/main/kubernetes</code>). More information is in <a href="https://quarkus.io/guides/deploying-to-kubernetes#using-existing-resources" rel="nofollow noreferrer">this link</a>.</p>
<p>The Kubernetes extension will aggregate the resources within the file <code>src/main/kubernetes/kubernetes.yml</code> into the generated <code>target/kubernetes/kubernetes.yml</code> (you will notice your configmap is there).</p>
<p>And finally, the Helm extension will inspect the <code>target/kubernetes</code> folder and create the Helm chart templates accordingly.</p>
<p>You can checkout a complete example in this <a href="https://github.com/quarkiverse/quarkus-helm/tree/main/integration-tests/helm-kubernetes-config" rel="nofollow noreferrer">link</a>.</p>
