<p>I run a local kubernetes cluster (Minikube) and I try to connect pgAdmin to postgresql, bot run in Kubernetes.
What would be the connection string? Shall I access by service ip address or by service name?</p>
<pre><code>kubectl get service

    NAME              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
    dbpostgresql      NodePort    10.103.252.31   &lt;none&gt;        5432:30201/TCP   19m
    kubernetes        ClusterIP   10.96.0.1       &lt;none&gt;        443/TCP          3d21h
    pgadmin-service   NodePort    10.109.58.168   &lt;none&gt;        80:30200/TCP     40h

kubectl get ingress:

    NAME              CLASS    HOSTS   ADDRESS        PORTS   AGE
    pgadmin-ingress   &lt;none&gt;   *       192.168.49.2   80      40h

kubectl get pod:

    NAME                        READY   STATUS    RESTARTS   AGE
    pgadmin-5569ddf4dd-49r8f    1/1     Running   1          40h
    postgres-78f4b5db97-2ngck   1/1     Running   0          23m
</code></pre>
<p>I have tried with 10.103.252.31:30201 but without success.</p>

Cosmin D
<p>Remember minikube is running inside its' own container, the NodePort clusterIPs you're getting back are open inside of minikube. So to get minikube's resolution of port and ip, run: <code>minikube service &lt;your-service-name&gt; --url</code>
This will return something like <a href="http://127.0.0.1:50946" rel="nofollow noreferrer">http://127.0.0.1:50946</a> which you can use to create an external DB connection. <a href="https://i.stack.imgur.com/wo44r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wo44r.png" alt="enter image description here" /></a></p>
<p>Another option would be to use kubectl to forward a local port to the service running on localhost ex. <code>kubectl port-forward service/django-service 8080:80</code></p>
