kube-guide

I. Docker, Kubernetes and Helm

The Three Musketeers of the modern software era

Docker, Kubernetes and Helm complement each other very well. Put together, these technologies, or concepts, make an extremely powerful mix. My journey into containerisation started with Docker, followed by container orchestrator, in this case Kubernetes and eventually I added Helm to enable the complete solution packaging experience.

What is Docker?

Docker has taken both software and infrastructure virtualisation to the next level where the concepts of Virtual Machines and Software Runtime got merged into a single Dockerfile declaration. The Dockerfile acts as documentation for your software. It is a source-controlled file, which in essence prevents configuration drift, and it allows you to treat your software as a single, deployable, self-contained package.

The container format standard is now governed by the Open Container Initiative (OCI).

Docker allows you to define your software runtime, dependencies and binaries that need to execute for your software to function properly. This is done using the Dockerfile as a mechanism to build an Image - a snapshot of your application at a time of the build. Docker also introduces another very important concept called Least Privileged. In essence making your software secure and self-contained, or isolated, from any external influences.

Once you have your Image built, all you have to do with it is to run it on what is called Container Runtime at which point your software becomes a running Container.

Finally, you can store your Images in Container Registries, such as Azure ACR, Google Container Registry, AWS ECR or IBM Cloud Container Registry. These effectively become your software catalogues from which you pull Images down for deployment at which point they become Containers.

What is Kubernetes?

Software solutions are rarely as simple as single container deployments. Often you will architect your solutions from multiple smaller components, referred as Microservices or APIs. Concepts such as Mesh App and Service Architecture (MASA) are often considered in such scenarios. Therefore, to pull these multi-app, multi-service deployments off you need something more than just Docker, you need container orchestrator, and luckily there’s one called Kubernetes (k8s)…

Kubernetes allows you to automate, scale and manage your containerised applications. It’s a production grade system which you can run in development, on-premises or in the cloud with Azure AKS, Google GKE, AWS EKS or IBM Managed Kubernetes Service.

Kubernetes is an open-source system that’s been developed and used at Google.

Kubernetes objects describe your containerised application’s desired state, such as number of instances, resource allocations and networking. These are defined in YAML Ain’t Markup Language (YAML) and are source controlled. This allows you to always maintain the desired state of your application stack and delegate to Kubernetes to ensure the actual state of your application meets the desired state as defined in YAML.

Finally, any changes to your application are then made to these YAML declarations and pushed automatically to your Kubernetes host via CICD pipelines.

What is Helm?

Simple applications could possibly get away with just deploying YAML declarations directly onto Kubernetes plane. However, more complex systems, or multi-app solutions, require much more robust approach. Enter Helm - a package manager for Kubernetes.

Helm allows you to package all your Kubernetes YAML declarations into a single, deployable, configuration driven package. You define your application as Helm Chart and that’s where your configuration and YAML declaration go to. You can even reference other Helm Chart here so that you build what’s called multi-chart or Umbrella Chart.

You can store your Helm Charts in Container Registries, good example is Azure ACR.

These effectively become your software catalogues from which you pull Helm Charts down for deployment into Kubernetes via CICD pipelines at which point these become running, containerised, applications.

Next »