K8s done right Part 1: start from helm charts

K8s is a very complex beast. But it give you a very good set of security defaults, and it is also a very well done implementation of a microservice application.

After installing Docker Swarm on some Customer, we are giving up on Swarm because the Enterprise version was acquired by Mirantis and now is marketed like "K8s" engine,  so Swarm seems K8s right now.

K8s business is based on the Cloud Provider services, and it is open source. Like WordPress business model, Google is always a bit forward on K8s, but you can get it up & running also on "minor cloud" provider like Digital Ocean and Linode.

I was lucky because in the last three years my Company asked to me and my group to learn K8s to reply to surging customer demand, and also to drive customer needs.

Docker Swarm seems a "underdog choice" right now, but I could be wrong.

To learn K8s my suggestion is to:

  1. Take some time learning K8s basics from official concept guide.
  2. Install Minikube and do the examples on your local machine
To be ready to the next level you should be able to:
  • Deploy a simple workload
  • Be able to understand how to create replica sets
  • Explore some "simple" scenario like CronJobs which is a useful feature: they are simpler to understand in respect of a long running web application (i.e. you must not expose a cron job on a http port!)
  • Apply a bit to be able to develop a docker application, publish to a registry and deploy on minikube. Minikube supports a toy registry you can use on Linux too, and it is quite simple to set up
After this level you can see some k8s advantages like ability to self-recover from a pod crash and so on

The next level is to

  1. Study Go template language, and extra "sprig" http://masterminds.github.io/sprig/ library.
  2. Study Helm package manager https://helm.sh/docs/topics/charts/#templates-and-values
  3. Have a look at the source of bitnami nginx helm chart (reason below)
  4. Look at a some complex example like Grana+Loki https://grafana.com/docs/loki/latest/installation/helm/
Helm chart is the way you will deploy k8s stuff.

Bitnami charts use some standard to define helm variables you use in you deployment. For instance service.type, service.port and so on. These conventions are important because often you will deploy "stacks" of helm charts.

To understand what we mean, download and look at bitnami Nginx chart is very flexible and can be used to deploy complex reverse-proxy configuration. A good Nginx config can often be the first thing you will need to set up you architecture.

In Part2 we will explore further how to organize your K8s setup, how to install Grafana and so on