<p>Currently, I have this in my <code>springboot</code> <code>application.dev.yaml</code>:</p>
<pre><code>datasource:
    url: jdbc:mysql://mysql/$DB_HOST?useSSL=false&amp;allowPublicKeyRetrieval=true
    username: root
    password: root
    driver-class-name: com.mysql.cj.jdbc.Driver
</code></pre>
<p>I want to add a dynamic value in username, passwords, <code>$DB_HOST</code> field so that it can pick those values from the secrets file in <code>Kubernetes</code>.
The secrets file in <code>Kubernetes</code> is encrypted with base64</p>

DarkDead
<p>In Spring Boot, any property can be overridden by an environment variable of the same name, with the characters changed to upper case, and the dots changed to underscores.</p>
<p>For example datasource.url can be overridden by setting an environment variable like DATASOURCE_URL, which you define in Kubernetes</p>
<p>Source: <a href="https://developers.redhat.com/blog/2017/10/04/configuring-spring-boot-kubernetes-secrets#setup" rel="nofollow noreferrer">https://developers.redhat.com/blog/2017/10/04/configuring-spring-boot-kubernetes-secrets#setup</a></p>
