This is a part of the series of posts on Getting an API running in Kubernetes. For this to make sense you could have worked through a few of the earlier examples, but if you haven’t, don’t worry. We’re going to create a cluster from scratch.

I recommend that you save your commands in various scripts so you can repeat them or modify them later.

In this series of articles – we’re going to get memcache going – This will help to speed up the API as we can avoid doing SQL execution by getting it from cache instead (which is super fast inside the same Kubernetes cluster) and we’ll expose it so it can be accessed fro elsewhere too.

Best to use the cloud console for this, as you’ll get a free Cloud shell with everything already installed, so start things off by going there and enabling billing for you project. See also

  • Installing memcache with Kubernetes
  • Exposing a memcache loadbalancer
  • Creating a test app for memcache on Kubernetes
  • Getting a simple app running on Kubernetes
  • Using mcrouter with memcached on Kubernetes

Creating the cluster

You can do this using the Cloud console UI. Here’s the options I’ve chosen


Since it’s only for a demo, I chose a small machine type, and started with 1 node.

However, I’ve made it autoscale up to 3 nodes.

At this point it’s handy to capture the CLI command line to a file so you can easily recreate the same cluster later.

which gives this


Finally, you get you’re cluster up and running.

Just one more thing to do before we can install stuff.

Setting context

You need to authorize the cloud shell and point to the correct default cluster (you could be running many different clusters).

  • Get the credentials for the given cluster
  • Check the context is now pointing at the correct cluster
  • you should get a list of clusters with an asterisk beside the default one

  • Check the nodes running in your default namespace

Next step

Installing Helm, Tiller and run up memcache. – Installing memcache with Kubernetes