<p>I'm trying to use the latest bitnami postgres chart to deploy postgres to a local kubernetes cluster (mac os, docker desktop 4.4.2, kubernetes 1.22.5):
<a href="https://github.com/bitnami/bitnami-docker-postgresql" rel="nofollow noreferrer">https://github.com/bitnami/bitnami-docker-postgresql</a></p>
<p>I have set the node port:</p>
<pre><code>primary:
  service:
    # Kubernetes Service type
    type: NodePort
    nodePorts:
      # Node port for PostgreSQL
      postgresql: '30000'
</code></pre>
<p>the service is visible:</p>
<pre><code>NAME                             TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
service/postgres-nodeport      NodePort    10.111.195.149   &lt;none&gt;        5432:30000/TCP   9m56s
</code></pre>
<p>but I cant access it from outside, eg:</p>
<pre><code>psql -h localhost -p 30000 -U myusername -d mydatabase
</code></pre>
<p>but I think it is configured correctly, because when I execute port-forward postgres is available:</p>
<pre><code>kubectl port-forward pod/postgres-nodeport-0 30000:5432 
</code></pre>

paka
<p>The Docker Desktop CINC has the <code>vpnkit-controller</code> so if you set a service to use a <code>LoadBalancer</code> it exposes it via your local machine:</p>
<pre><code>primary:
    service: 
      type: &quot;LoadBalancer&quot;
</code></pre>
<p>It is also assigned a random NodePort but the <code>vpnkit</code> will expose the default port of 5432 on localhost.</p>
