<p>I just installed Kubernetes with minkube on my desktop(running Ubuntu 18.10) and was then trying to install Postgresql on the desktop machine using Helm.</p>

<p>After installing helm, I did:</p>

<pre><code>helm install stable/postgresql
</code></pre>

<p>When this completed successfully, I forwarded postgres port with:</p>

<pre><code>kubectl port-forward --namespace default svc/wise-beetle-postgresql 5432:5432 &amp;
</code></pre>

<p>and then I tested connecting to it locally from my desktop with:
    psql --host 127.0.0.1 -U postgres
which succeeds.</p>

<p>I attempted to connect to postgres from my laptop and that fails with:</p>

<pre><code>psql -h $MY_DESKTOP_LAN_IP -p 5432 -U postgres

psql: could not connect to the server: Connection refused
Is the server running on host $MY_DESKTOP_LAN_IP and accepting TCP/IP connections on port 5432?
</code></pre>

<p>To ensure that my desktop was indeed listening on 5432, I did:</p>

<pre><code>netstat -natp | grep 5432

(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN               17993/kubectl       
tcp6       0      0 ::1:5432                :::*                    LISTEN      17993/kubectl   
</code></pre>

<p>Any help anyone? I'm lost.</p>

J. Cool
<p>you need to configure <code>postgresql.conf</code> to allow external client connections look for <code>listen</code> parameter and set it to <code>*</code>, it is under your postgres data directory, and then add your laptop's ip in <code>pg_hba.conf</code>. It controls the client access to your postgresql server, more on this here - <a href="https://www.postgresql.org/docs/9.3/auth-pg-hba-conf.html" rel="nofollow noreferrer">https://www.postgresql.org/docs/9.3/auth-pg-hba-conf.html</a></p>
