This is a step in Getting an API running in Kubernetes

Building your demo app
Before getting into the Kubernetes configuration, the first step is to create a demo App, which will run on Node/Express. It’ll playback any post body, or the contents of the ?data= parameter on a GET request. It’ll also support CORS so you can test it from a JavaScript app.




Building a docker image

So that Kubernetes can access your app, you need to build an image, then load it somewhere accessible to both you and Kubernetes. The Google Cloud container registry is perfect for that, so the steps are

  • create your app
  • test it
  • create a Docker image
  • load it to Google Cloud Registry.

Testing the app

Before creating an image, you can test it using the web preview feature of the cloud shell

  • Start your app
  • Kick off-web preview mode on port 8080
  • pass a data parameter
  • The result should be echoed

Creating an image and loading to the container registry

First, create a simple Dockerfile. This will create an image with Node (from the Alpine build), plus the dependencies, and the App


executing this script will

  • make an image
  • tag it with the project name and the gcr repo
  • push it to gcr

and in your cloud console

Ready for Kubernetes deployment see the next steps below

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