Kubernetes manifest written in yaml for defining a k8s cluster
Helm charts for defining entire application stacks in a k8s cluster
What is Kubernetes?
An open-source platform which manages computing, networking and storage resources through a set of standard resource definitions such as a ReplicaSet, Deployment or a Service among others.
Is extensible as developers can define their own custom resources.
Facilitates declarative cluster definition through kubernetes resource definition in yaml files.
Enhances portability of applications on different infrastructure providers
Once the developer learns about kubernetes, it's easier for developers to define their application infrastructure with minimal assistance from operations.
As kubernetes provides a standard way to define the application, it means your application is more portable and can be shifted more easily from one cloud provider to another or even to bare metal kubernetes clusters.
A declarative way to model your infrastructure.
As a collection of yaml files defines the application infrastucture, it is a form of documentation or visibility of the desired state of the applications.
Monolithic applications generally run as one highly coupled unit that must be deployed, redeployed and scaled as a whole. Microservices on the other hand are loosely coupled components which can often be deployed, redeployed and scaled independently of one another (as long as the api between components remains backwards compatible). Kubernetes makes it easy to deploy and scale applications as microservices as they can communicate to one another over the cluster network.
Kubernetes is a versatile tool and can handle many types of workloads for varied types of applications
A few words about helm
What is Helm ?
A package manager for apps, utilities and software tools to be deployed onto a kubernetes cluster.
The packages are effectively collections of files that define some application, tool or utility that will be rendered by a server component called tiller and then in turn sent to the kubernetes control plane for further processing.
What are the benefits over plain kubernetes constructs?
Helm charts provide access to the power of a templating system (go templates)
Extract important variable assignments into it's own file - values.yaml
Have control workflows so that conditional yaml files can rendered
Composed of two components (Version 2 of helm):
Runs on the kubernetes cluster
Runs on the developers desktop (typically - optional)
Runs on the kubernetes cluster
Responsible for installing/removing resources by interacting with the kubernetes api server
Helm Architecture - client
A cli tool is available for the end user
Sends the commands and chart data to tiller for further handling
helm install --name myblog stable/wordpress
Helm Architecture - Tiller
Runs in a pod of its own in the kube-system namespace
Responsible for installing/removing/updating cluster resources by interacting with the kubernetes api server
Based on the chart data and helm command received, tiller sends the appropriate instructions to the kubernetes api server so that the helm release is deployed
Helm - A chart
What is a chart ?
A collection of files for defining resources that are to run on the Kubernetes cluster.
Collectively, the group of resourcess constitute the application, tool or whatever software is being deployed on the server.
Helm - A repository
What is a repository (in helm terms) ?
A place where versions of the chart are stored, archived and made available for retrieval by kubernetes clusters. Essentially, it is a simple HTTP server of yaml and tar files. An index.yaml is an essential file that defines the helm package.
NAME CHART VERSION APP VERSION DESCRIPTION
weaveworks/flux 0.2.2 1.5.0 Flux is a tool that automatically ensures that ...
weaveworks/flux 0.2.1 1.4.2 Flux is a tool that automatically ensures that ...
weaveworks/flux 0.2.0 1.3.1 Flux is a tool that automatically ensures that ...
weaveworks/flux 0.1.1 1.4.1 Flux is a tool that automatically ensures that ...
weaveworks/flux 0.1.0 1.3.1 Flux is a tool that automatically ensures that ...
Helm - A release
What is a helm release ?
A helm release is an instance of a chart running on a kubernetes cluster. A release is named and more than one release with different names can be run on a kubernetes cluster. The name of a release is unique for a given installation of tiller.
What is it?
A toolkit for deploying your kubernetes cluster using gitops.
It is composed of a flux operator, a flux helm operator and a memcached pod that must first be setup in the kubernetes cluster. I will refer to it as the 'flux system'
The flux system is synced with your kubernetes cluster configuration repository with read and write access.
Based on the policies declared in the config repo, The flux system will watch for new images being pushed to the docker registry. When a new image is detected, the image is pulled and deployed onto the kubernetes cluster and the configuration repository is updated via a git commit with the tag/sha of the latest image. This feature is enabled through annotations in the config repository.
The flux system will also watch for any changes to the configuration repository and any changes to the state of the cluster wil be detected in the yaml files and applied to the cluster