<p>I have a microservice &quot;MyService&quot; in DotNet that has a database. While development time I have a local postgreSQL and I have the connectionstring in my appsettings config:</p>
<pre><code>{
 &quot;MyConString&quot;: ....
}
</code></pre>
<p>Now in production env I will have a postgresCluster that I start with terraform and a helm chart:</p>
<pre><code>resource &quot;helm_release&quot; &quot;postgres-cluster&quot; {
  name       = &quot;postgres-cluster&quot;
  repository = &quot;https://charts.bitnami.com/bitnami&quot;
  chart      = &quot;postgresql-ha&quot;
  namespace  = local.namespace

  ....
}
</code></pre>
<p>No I deploy my service in the same kubernetes cluster (Azure / aks) as the postgres cluster with my kubernetes deployment:</p>
<pre><code>apiVersion: v1
kind: Service
metadata: 
  name: my-service-service
spec:
  selector:
    app: my-service
  ports:
    - protocol: TCP
      port: 80
      targetPort: 9376
</code></pre>
<p>So my order is: The infrastructure will be deployed once with terraform (kuberentes, postgresql), then everything is running and then my service will be deployed.</p>
<p>So, I need to put the missing puzzle pieces together: How to get the information from the running helm chart into my kubernetes service deployment to replace the connection string in the appsettings?</p>

PassionateDeveloper
<p>You can use helm commands to dump all values.</p>
<p>First get helm release deployed in namespace.</p>
<pre><code>helm list -n ingress-controller
NAME            NAMESPACE               REVISION        UPDATED                                 STATUS          CHART                   APP VERSION
ingress-nginx   ingress-controller      1               2022-11-03 18:57:32.4117796 +0500 PKT   deployed        ingress-nginx-4.3.0     1.4.0
</code></pre>
<p>In my case release name is ingress-nginx. Now you can dump your specified values from release.</p>
<pre><code>helm get values ingress-nginx -n ingress-controller
</code></pre>
<p>If you want to dump all values from the release. You can do this way.</p>
<pre><code>helm get values ingress-nginx -a -n ingress-controller &gt; values.yaml
</code></pre>
<p>From values.yaml file you can get strings/config details of your choice.</p>
<p>OPTIONAL:
There is one IDE of kubernetes that help you get all these values from UI. <a href="https://k8slens.dev/" rel="nofollow noreferrer">Lens</a>. I use it frequently for doing such tasks on daily basis.</p>
