<p>My setup (running locally in two minikubes) is I have two k8s clusters:</p>
<ol>
<li>frontend cluster is running a golang api-server,</li>
<li>backend cluster is running an ha bitnami postgres cluster (used bitnami postgresql-ha chart for this)</li>
</ol>
<p>Although if i set the pgpool service to use nodeport and i get the ip + port for the node that the pgpool pod is running on i can hardwire this (host + port) to my database connector in the api-server (in the other cluster) this works.
However what i haven't been able to figure out is how to generically connect to the other cluster (e.g. to pgpool) without using the ip address?</p>
<p>I also tried using Skupper, which also has an example of connecting to a backend cluster with postgres running on it, but their example doesn't use bitnami ha postgres helm chart, just a simple postgres install, so it is not at all the same.</p>
<p>Any ideas?</p>

Jim Smith
<p>For those times when you have to, or purposely want to, connect pods/deployments across multiple clusters, Nethopper (<a href="https://www.nethopper.io/" rel="nofollow noreferrer">https://www.nethopper.io/</a>) is a simple and secure solution. The postgresql-ha scenario above is covered under their free tier.  There is a two cluster minikube 'how to' tutorial at <a href="https://www.nethopper.io/connect2clusters" rel="nofollow noreferrer">https://www.nethopper.io/connect2clusters</a> which is very similar to your frontend/backend use case.  Nethopper is based on skupper.io, but the configuration is much easier and user friendly, and is centralized so it scales to many clusters if you need to.</p>
<p>To solve your specific use case, you would:</p>
<ol>
<li>First install your api server in the frontend and your bitnami postgresql-ha chart in the backend, as you normally would.</li>
<li>Go to <a href="https://mynethopper.com/" rel="nofollow noreferrer">https://mynethopper.com/</a> and
<ul>
<li>Register</li>
<li>Clouds -&gt; define both clusters (clouds), frontend and backend</li>
<li>Application Network -&gt; create an application network</li>
<li>Application Network -&gt; attach both clusters to the network</li>
<li>Application Network -&gt; install nethopper-agent in each cluster with copy paste instructions.</li>
<li>Objects -&gt; import and expose pgpool (call the service 'pgpool') in your backend.</li>
<li>Objects -&gt; distribute the service 'pgpool' to frontend, using a distribution rule.</li>
</ul>
</li>
</ol>
<p>Now, you should see 'pgpool' service in the frontend cluster</p>
<blockquote>
<p>kubectl get service</p>
</blockquote>
<p>When the API server pods in the frontend request service from pgpool, they will connect to pgpool in the backend, magically.  It's like the 'pgpool' pod is now running in the frontend.</p>
<p>The nethopper part should only take 5-10 minutes, and you do NOT need IP addresses, TLS certs, K8s ingresses or loadbalancers, a VPN, or an istio service mesh or sidecars.</p>
