<p>Is there any way to deploy lagom projects on kubernetes in different environments (ie. dev,stage,prod) such that I can use one image with multiple configuration overrides?</p>

<p>For example, let's say I have an environment variable, <code>foo=bar-{{env}}</code>. I want to build and publish one image and override configurations so that in dev <code>foo=bar-dev</code> and in prod <code>foo=bar-prod</code>.</p>

<p>Currently, my understanding is that the <code>application.conf</code> is tied to the image and cannot be overridden. If this is correct, is there a way to work around this so that I do not need to create multiple images, one for each environment?</p>

bgao3
<p>Alternatively, you can set typesafe config system property variable to override application.conf file</p>

<ul>
<li><p>application.conf: default conf file use in development</p>

<blockquote>
<pre><code>foo: bar-dev
</code></pre>
</blockquote></li>
<li><p>application.prod.conf:</p>

<blockquote>
<pre><code>include "application.conf"
foo: bar-prod
</code></pre>
</blockquote></li>
</ul>

<p>Set dockerfile system variable:</p>

<pre><code> ENTRYPOINT java -Dconfig.resource="$CONFIG_FILE"
</code></pre>

<p>In kubernetes yml</p>

<pre><code> env:
     - name: CONFIG_FILE
       value: "application.prod.conf"
</code></pre>
