Connection issues on Google Cloud Platform

Hello everyone,

I’m having an unexpected issue with my current Couchbase cluster running on GCP/Kubernetes.

So I have created my cluster based on this guide and everything worked without an itch.

However, I’d still like to be able to use this cluster to develop locally while connecting to the database on GCP.
So, I have my static IP configured according to the public IP/Service defined by the couchbase-master.yml which gives me access to the Admin WebUI.

Pods in another cluster are also able to use this database without much trouble (except that from time to time requests will take over 30s to respond) by using that public IP.

On the other hand, running my node.js services/apps locally by pointing to that same public IP do NOT throw a connection timeout error but never return any data. Requests to the database seem to just hang without any more output.

I’ve also added quite a few forwarding rules to the GCP firewall, show by this printscreens:



What is the issue here? What am I doing wrong? Why can’t I get a query/get to work?

Best Regards,
Celso Santos

@celso.santos - I am trying this now. Were you able to overcome this issue on GCP. If so, how?

Thanks for any input.

Best,
Jason

Well, I didn’t overcome this (by choice) but I did find some information on the subject and why I wouldn’t be able to connect.

Basically, you’ll notice that your instances will get a “name” which is pretty much the host IP (internal IP on GCP).
When your client connects to the cluster, the cluster will send back a mapping of the nodes, including the hostname, back to the client app.

What your app/client is getting back is just the internal IPs as hostnames and these IPs are not available externally of GCP.

One way to overcome this is make sure each of your instances has a hostname that is also a publicly available DNS name (like, node1.yourcompany.com and node2.yourcompany.com) and also make sure that each of these nodes would have an External IP so you could map everything.

Another way might be by using a proxy that would map each of the internal nodes IPs into a single one available externally, but I believe this would introduce issues with client/cluster mappings, so I cannot recommend this approach although you are welcome to try as I’m curious to what would be the outcome of this.

Eventually I chose to have a development cluster locally and keep the rest on GCP for each of my environments (dev, staging and prod)

BR,
Celso Santos