There was a time when Docker was the top dog in the industry (it still is but bear with me). Everybody was in love with it, running their projects and products from containers that could hold not only the software but also the libraries and everything needed to run it seamlessly. Everybody was happy when their software ran smoothly on their servers, but when it had to be moved to another one, it was chaotic. That’s when Docker Compose was born. It was OK, but it wasn’t enough when you had to run it on 10, 100, or even 1000 servers. Enter Kubernetes (also known as K8), the best solution, as it allows the management of distributed applications across multiple environments.
And it gets even better!
Combining Kubernetes and Helm.
Helm is a packaging manager for Kubernetes. It’s the best companion for K8 because it makes it even easier to install, upgrade, and manage all your applications, regardless of the size or architecture. Let’s take a look at all the benefits and powerful uses of this dynamic duo.
Kubernetes in a nutshell
Kubernetes is a technology that gives you the power to run a lot of containers on different servers. The best part of K8 is that it is a declarative system. You can create a deployment, asking to run some tasks with N containers and N copies. This deployment goes right to the cluster services, and it’s then distributed to all the tasks, creating a cluster.
The cluster has a control panel, that is, the Kubernetes servers that orchestrate the nodes. They can run about 100 pods, assigning each pod to a worker. Those workers are called nodes where the containerized applications are run. The node hosts the pods, which are the components of the workload declared in the deployment.
There are other components: a scheduler that moves those containers from one place to another. The API communicates with the Kublers, a service that runs in each worker and allows the connection, among others.
One of the biggest benefits of Kubernetes is its reliability. If, for instance, one of those workers stops working, the service (located in the cloud provider) will take that container and move it to another worker, trying to comply with what is asked in the deployment.
Kubernetes makes it easier to automatize the implementation and upgrading of applications. Also, it makes it simpler and cleaner when working on platforms as a service (PaaS) and more flexibility in infrastructure as a service (IaaS), allowing portability.
Developed by Google in 2015, the technological monster donated Kubernetes to the Cloud Native Computing Foundation. The greatest advantage of an Open-Source tool is that people keep developing amazing tools that can cover all the bases that the Kubernetes left, and Helm is one of them.
Helm with Kubernetes: the dynamic duo
Helm is known as the package manager for Kubernetes. It sounds simple, but this brief description doesn’t cover all the benefits of combining these tools in your process. This open-source project was created to provide users with a practical way to manage the YAML file created on Kubernetes.
The process of organizing your Kubernetes YAML begins with creating Helm Charts. These charts contain one or more Kubernetes manifests. Each chart can have child and dependent charts. Looking at them, it’s easy to recognize a tree.
The magic is that Helms can install the whole tree of a project just by running the installation of the top-level chart. Forget about listing files and going one by one. Helms only need a single command to install the application.
Using charts is so versatile that you can version manifest files, letting you install specific versions and keeping some previous configurations. Helm goes to the rescue if something goes wrong because it keeps a release history of all deployed charts, making it easier to go back to a previous release.
Helm was created for Kubernetes, so there isn’t a need to create syntax files to make it compatible. You just need to drop a template file into a new chart to use it. That’s all.
Benefits of using Helm
- The most popular one: installing applications with a single command
It isn’t an exaggeration because a chart contains other charts that can be deployed with a command. Like a falling house of cards, one simple move triggers everything.
- Reusability and sharing
You can compress charts and send them to a repository. Also, it’s possible to find and deploy existing Helm charts.
- Simplifies management and complexity
Leave the exhausting microservices in the past. Charts have useful templates for K8 resources.
- Helm keeps the records and history of previous deployments, making it easier to roll back to a previous version in case of an emergency.
- Recycle and reuse
Change the parameters of the same chart and use it for different environments (dev, staging, production, etc.).
- Customize on the go
Applications can be changed during the deployment.
Infrastructure as code, the true key
Whenever you use a configuration language to manage and provide infrastructure, you’re using infrastructure as a code. Doing this with Helms and Kubernetes is pretty easy because of Helm’s nature.
IaC helps to make a standard when creating cluster configurations, besides reducing human error as it automatizes those processes. This repetition not only can help employees to know your infrastructure, but it also produces predictable results that translate into consistency.
If you want to use Kubernetes, it is almost imperative to implement Helms if you wish to unravel all the power of K8. The truth is that IaC is the most efficient way to manage a Kubernetes cluster, and Helms is the most natural to apply it.