Getting cockroachDB running with Kubernetes

Cloud Platform (intermediate level) posted on 1st Feb 2018

In Getting cockroachdb running on google cloud platform, I went through how to get a few docker containers running in an insecure, 3 node cockroachdb on a single VM. In real life, you'll want to run secured multiple nodes across multiple VMs with shared storage. This can be super complex and error prone if you, like me, don't really know what you're doing. Luckily, Kubernetes can help with orchestration, and cockroach have put together a great guide and some preconfigured .yaml files to help with that. I'll walk through that in this post.

Micro VM

One of the troubles there is that you'll start to get this pretty soon, as it really is a pretty small machine.

with this recommendation

But a small machine will cost about $15 a month.

The cloud shell

The cloud console (you can also get to it from the Apps Script IDE) comes with what they call a cloud shell, but actually it's a fully functional VM (a small configuration). Here's it is here with 4 terminal sessions open on it - it has 1.7GB memory as per the small configuration VM.

It's running Debian

and it's persistent, so you can load things on it.

You can easily access the cloud shell from your cloud console

and directly from your Apps Script project (note that it's the same machine, regardless of the project)


There are of course limitations on what Google want you to do with this handy instance. Read about them here.

Installing Node

Now you can install node and you have your own Linux VM for free that you can use to install Node and play around with clasp for Apps Script.
curl -o- | bash
nvm --version
nvm install node
nvm use node
>console.log ('roger that');
roger that
  • There's a bit of a delay where nothing seems to happen at the first stage. Just be patient.
  • You'll see message about closing and opening your terminal session, or executing a command that looks  something like this. This creates some environment variables so you can run nvm to install node
export NVM_DIR="/home/bruce/.nvm"
[ -s "$NVM_DIR/" ] && \
. "$NVM_DIR/" # This loads nvm

Removing Node and Nvm

If you want to get rid of it, then you can just delete the directories it lives in. 
sudo rm -rf /usr/local/nvm
rm -rf .nvm

Why not join our forum, follow the blog or follow me on twitter to ensure you get updates when they are available.