CockroachDB and Kubernetes Clustering Help/Info required

Hi,

Firstly, complete noob here. I’ve been using K8’s a total of about 20 hours :smile:

I’m looking at deploying CockroachDB across two sites for work (datacenter and an additional site in one of our offices) and have been following this article and was eventually able to stand up a cluster with 3 pods, I’m not sure if it needs updating as there were a few errors getting the example.yaml file to work.

Reading through the documentation for hosting across multiple clusters I see tutorials for Google and Amazon web services.

Question 1: Do we NEED to use one of those or is it possible to host it ourselves without those? We’re planning to use HA Proxy between the two sites if that matters.

Question 2: The article I followed was for a local cluster, If I work on this cluster for now is it easy enough for me to add a second cluster, or make it “not local”? Or am I better off starting with both? I appreciate part of that is down to our networking, which we can work around. I’m just curious as to how the process would work.

Question 3: Acessing the web console. How can I access this remotely?

The current set up is an Ubuntu VM which can only be accessed from our network. How can I set CockroachDB to allow connections to the web console from any IP or even a handful of IP addresses on the same network? I’m don’t want to be able to access the console over the internet/externally.
I’m not sure where to specify this in my yaml file.

Thanks,

Phil

Hi Phil,

I’m a Product Manager at Cockroach Labs.

Question 1: Do we NEED to use one of those or is it possible to host it ourselves without those? We’re planning to use HA Proxy between the two sites if that matters.

You do not need to use one of those. CockroachDB and Kubernetes are cloud-agnostic and can work on baremetal. It is possible to host it yourself and/or use other cloud providers, such as Azure.

Question 2: The article I followed was for a local cluster, If I work on this cluster for now is it easy enough for me to add a second cluster, or make it “not local”? Or am I better off starting with both? I appreciate part of that is down to our networking, which we can work around. I’m just curious as to how the process would work.

Here is our documentation for deploying non-local single K8s clusters. To clarify, are you trying to make a multi-cluster deployment that includes your existing local cluster?

Question 3: Acessing the web console. How can I access this remotely?
You can access the DB Console by opening a SQL shell in one of the pods. Here’s our docs for that (Access the DB Console).

The current set up is an Ubuntu VM which can only be accessed from our network. How can I set CockroachDB to allow connections to the web console from any IP or even a handful of IP addresses on the same network? I’m don’t want to be able to access the console over the internet/externally.

As described in our DB Console Access docs (linked above), by making your clusters insecure, it can be accessible by all users. For secure clusters, one has to be granted a username and password to access the DB console.

Let me know if you have any more questions. Happy to help

John

Also, be sure to join our #kubernetes and #kubernetes-operator channels in our Community Slack.

Hi John, first of all thank you for your reply.

A little background…At the moment we have a monitoring and alerting system which uses a NodeRed application to manage the alerts. These are stored in an Azure SQL database currently. The hope is to replace this database with CockroachDB and host it ourselves across two sites. I’ve looked at potentially using Ubuntu to deploy K8’s clusters https://ubuntu.com/kubernetes/install

At the moment, my intention is to get a single cluster running and access the console at http://localhost:8080 - However this is installed on an Ubunutu VM with no desktop environment, so the port forwarding doesn’t help, i could install a desktop but with this being a server I’d prefer not to. Ideally I’d like to be able to allow access to that to my colleagues so they can monitor the cluster. The server would only be accessed from within our Citrix environment.

I entered the SQL shell and created a user account with admin access, however the web console on localhost won’t load at all. I was hoping there would be a setting for the listen address I could set so I can access it. I found the listen-addr argument in the manual deployment but I’m not sure how to apply it to the K8’s example.yaml file

I’d hoped to get one cluster running and do some testing with that, then once the hardware for the second site is configured I’d like to add the new cluster to the existing one.

I’ll read through the links you’ve provided and I will probably have more questions!

Thanks John,

Phil