<p>I have this ConfigMap where I am constructing a <code>app-config.json</code> file that I pass into Angular. This file is how I get environment variables into Angular as they must be served.</p>
<p>Below is how I thought passing variables into the JSON would work in ConfiMap:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: frontend-settings
data:
  app-config.json: |-
    {
        &quot;keycloakUrl&quot;: &quot;http://${minikube ip}:${keycloak_port}/auth&quot;,
        &quot;realm&quot;: &quot;eshc&quot;,
        &quot;clientId&quot;: &quot;eshc-frontend&quot;,
        &quot;backendApi&quot;: &quot;http://localhost:${backend_port}&quot;
    }
</code></pre>
<p>The problem is that these are not evaluated. I want to pass Kube service aliases, and the <code>minikube ip</code> command as in the example above. Could someone point me in the right direction as to how I might do this?</p>
<p>Thanks in advance!</p>

slipped_disk
<p>Kubernetes doesn't provide this facility in the API.</p>
<p>You can do this at deploy time with <a href="https://helm.sh/" rel="nofollow noreferrer">helm</a> or kubectl's <a href="https://kubectl.docs.kubernetes.io/pages/app_management/introduction.html" rel="nofollow noreferrer">kustomization features</a>.</p>
<p>Depending on your use case, this can also be done at runtime in a container <a href="https://docs.docker.com/engine/reference/builder/#entrypoint" rel="nofollow noreferrer">entry point</a> before the app starts up or in a Kubernetes specific <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/" rel="nofollow noreferrer">init container</a>. Avoid the init container unless you are working with shared file systems, or with the Kubernetes API to apply these changes.</p>
<p>From your example it looks like everything should be available at deploy time, maybe not the minikube IP. For that you should be able to use the magic DNS name <code>host.minikube.internal</code></p>
