Google Cloud with Kubernetes and Deis

Last weekend the Chartered Institute for IT (British Computer Society) organised a workshop provided by Rimantas Mocevicius from the DEIS project.

Kubernetes is an open-source system for automating deployment, scaling, and management of containerized application.

If you are new to Kubernetes and DevOps you can check the Illustrated Children’s Guide to Kubernets in video or text.

The DEIS project implements a simple interface to a Kubernetes Cluster. So that, it is possible to use very simple commands (like Heroku) to manage and scale instances in the cluster.

The aim of the workshop was to install a sample application using the DEIS workflow.

The workshop documentation was very good so it is possible to reproduce the steps by following these three guides:

  1. How to setup Kubernetes Cluster on Google Container Engine.
  2. Introduction to Kubernets
  3. DEIS workflow introduction

A summary of each of this guides is described below:

Setting Up the Kubernetes Cluster

The first step was to create a Google Cloud Account and create a cluster of at least three nodes.

Google has done a good work simplifying the way to setup the access credentials. This setup is easier than in the Amazon Cloud.

It is also possible to use the Google Cloud Shell which provides a ssh session in the browser to the cluster. This eliminates the need to install local dependencies, but it is possible to install the administration tools locally if this way is preferred.

The new cluster comes with Kubernetes already installed for its administration. So after setting some defaults, the cluster is ready to use.

Introduction to Kubernetes

This part of the workshop showed the Kubernetes architecture and main concepts such as the PODs, the deployments, labels and selectors, services, volumes, among others.

We created different types of configurations using the Kubernetes commands and tested the rolling-updates, the resource management limits and how to deal with secrets to protect account credentials.

Finally, we looked at Helm, a package manager, and installed the chart ‘weavescope’ from Weave to generate a diagram of our cluster.

DEIS workflow

The third part of the workshop was aimed at installing the DEIS workflow in the cluster and testing it with a demo application.

DEIS Workflow is an open source Platform as a Service (PaaS) that makes it easy to deploy and manage your applications on your own servers.

DEIS Workflow comes as a Helm chart and it is a collection of Kubernetes services that are deployed into the cluster inside a namespace named ‘deis’.

Using namespaces in the cluster is a good way to manage several services so that the DEIS services are not mixed up with our own application services.

After setting up a DEIS user account and ssh credentials, we are ready to deploy our applications in the cluster.

To deploy an application, it is as simple as cloning the application repository, creating a DEIS application and pushing the code to the master branch of the DEIS application. For example:

$ git clone https://github.com/deis/example-go.git 
$ cd example-go
$ deis create example-go
$ git push deis master

This workflow is very similar to Heroku and hides the complexity of managing the Kubernetes cluster to the developers.

Deis also provides commands to scale, release, configure, access logs, etc. In a similar way to Heroku.

In summary, I found this workshop very valuable as it provided a lot of exercises to learn how to use Kubernetes and DEIS.

These open source tools are now reaching a level of maturity that make them good alternatives when designing deployment architectures for production systems.

If you are interested in this topic, you can join the London Kubernetes Meetup and come along to the monthly meetings.

If there are other open source platforms for DevOps that you would like to share with us please do so in the comments!

Like what you read? Give Codescrum a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.