<p>I have application.yaml file which contains database properties fetched from Secrets object in Kubernetes Cluster in separate deployment environment. However, when I try to run that application locally (Spring Boot application), it fails to load for obvious reason that it can't find the datasource due to not having actual values in application.yaml file.</p>
<p>Does anyone have any idea how to start application locally without hardcoding database credentials in yaml file?</p>
<pre><code>url: ${DB_URL}
username: ${DB_USER}
password: ${DB_PASSWORD}
</code></pre>
<p>I don't have Kubernetes cluster locally.</p>

heart_coder
<blockquote>
<p>I don't have Kubernetes cluster locally.</p>
</blockquote>
<p>You will need something to run .yaml files locally probably &quot;minikube&quot;. Add secrets to that environment using another file(local-secrets.yaml) or directly using &quot;kubectl&quot;.
See <a href="https://kubernetes.io/docs/concepts/configuration/secret/#creating-your-own-secrets" rel="nofollow noreferrer">here</a> how to add secrets.</p>
<p>The object will look something like this (base64'ed)</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: mysecret
type: Opaque
data:
  username: YWRtaW4=
  password: MWYyZDFlMmU2N2Rm
</code></pre>
