<p>I have read the documentation of helm and know release = chart + config. Now I am trying to compose the deployment of a classic web application, containing the following components:</p>
<ol>
<li>PostgreSQL</li>
<li>Memcached</li>
<li>Web Application <code>webapp</code></li>
</ol>
<pre><code>helm install staging-pg stable/postgresql
helm install staging-memcached bitnami/memcached
helm install staging-webapp my-repo/blog
</code></pre>
<p>From my understanding, the third release needs to know the endpoint of PostgreSQL and Memcached. How to pass the endpoint of the database and Memcached to the third release?</p>

Ryan Lyu
<p>If you have that setup, then you need to pass the database hostname as a Helm value.  A Helm chart doesn't have any direct way to get outputs or any other information from other releases.</p>
<pre class="lang-yaml prettyprint-override"><code># my-repo/blog/values.yaml
postgresql:
  host: staging-pg-postgresql
memcached:
  host: staging-memcached
</code></pre>
<pre class="lang-yaml prettyprint-override"><code># my-repo/blog/templates/deployment.yaml
env:
  - name: PGHOST
    value: {{ quote .Values.postgresql.host }}
</code></pre>
<p>Rather than separately install the dependencies you may find it more useful to use Helm <a href="https://docs.helm.sh/docs/topics/charts/#chart-dependencies" rel="nofollow noreferrer">dependencies</a> to say that your blog application depends on the database and the cache.  However, you will still need to know how those charts create their Service names.  Often a pattern like <code>{{ .Release.Name }}-postgres</code> will work but this is more a convention than a hard rule.</p>
