Blog
Harness Platform

Comparing Helm vs Kustomize | Harness Blog

Two tools to tackle configuration and package management inside the Kubernetes ecosystem: Kustomize and Helm, respectively. Learn how they compare in this post!

TL;DR

Kustomize and Helm are essential tools for managing Kubernetes configurations and packages, respectively, streamlining deployment processes and reducing the complexity of handling multiple manifests and clusters. Harness enhances these tools by providing support for both, enabling more efficient and simplified Kubernetes deployments.

The Kubernetes ecosystem is still relatively new. With Kubernetes hitting GitHub in the Summer of 2014 and the first 1.0 release of Kubernetes available in the Summer of 2015, the pace and advancements are still fresh in the minds of many. Like any piece of application infrastructure, operational tasks as workloads of substance started to be placed on Kubernetes became important. 

Kubernetes works off a concept of resources and these resources are typically described by YAML-based manifests; e.g. deployment.yaml. If experimenting with Kubernetes for the first time, you might deploy a simple singular image, like NGINX, and can describe a deployment in a linear manifest, e.g. one deployment.yaml. Because Kubernetes is pluggable and you can change the opinion of Kubernetes pretty easily, the number of deployment resources (YAML files) increases for any workload of substance. 

With a two-prong rise in the number of manifests needed to deploy (for example, in a microservice architecture) and the number of Kubernetes clusters to maintain and deploy to, which would most likely need cluster-to-cluster differences (e.g. networking stack), organizations can easily get overrun with manifests to support this. Enter two tools to tackle configuration and package management inside the Kubernetes ecosystem: Kustomize and Helm, respectively.

What is Kustomize?

Kustomize is a configuration management tool for the Kubernetes ecosystem. Configuration management, as a core discipline, focuses on maintaining consistency across environments. With the new paradigms that Kubernetes has been ushering in and a shift of computing resources to become more ephemeral, the number of Kubernetes clusters/environments continues to expand. Embracing ephemeral infrastructure, even a Kubernetes cluster itself can be recycled and recreated. The beauty and challenge of Kubernetes is that Kubernetes can codify operational tasks that application infrastructure needs, more often than not increasing the length and scope of Kubernetes manifest files. 

As an implementation, Kustomize is a declarative templating engine that works off a concept of refactoring Kubernetes manifests. Base Kubernetes YAMLs are matched against Kustomize configurations (overlays and Kustomization files) and refactored/replaced per the logic defined in these files. Because of the large number of applications heading towards Kubernetes and maintaining the clusters themselves, Kustomize helps achieve configuration management across Kubernetes resources and applications that are deployed to Kubernetes. 

Kustomize Structure

Kustomize works off a concept of “where, what, and how” to refactor specific Kubernetes manifests. The “where” to refactor/change are the base manifests, e.g. a deployment.yaml. The “what” to change are the overlays or small snippets of YAML to change, e.g. a replica count, volume mounts, etc. The “how” to change are the kustomization/config files. 

Helm vs Kustomize

Kustomize Files

If you have not used Kustomize before, assuming you have existing Kubernetes manifests (a deployment/service/etc/.yaml) to use as a base, the Kustomize Files (kustomization.yaml) will be where the Kustomize logic lives. Matching logic can work on specific Kubernetes resources, e.g. a specific base file, but more dynamically can match on specific Kubernetes Labels and Annotations inside those base files. 

Pros of Kustomize

A contemporary comparison of using Kustomize falls on the alternatives, which is the status quo of not using a package/configuration manager and comparing Kustomize against Helm V2. 

Using a templating engine/configuration management solution takes away the burden of keeping up with multiple manifests for specific changes. 

The status quo would be to keep every change in a manifest in source control, and small nuanced differences would be hard to tell what to apply to what environment in Kubernetes based on file name alone. 

Kustomize can natively be run by the Kubernetes Command Line Interface (CLI), kubectl from version 1.14. When compared to Helm V2, which requires an elevated privilege pod named Tiller on your Kubernetes cluster, Kustomize can be up and running without that cluster dependency. 

Cons of Kustomize

Like any technology, there is a learning curve and challenges when implementing and adopting. Depending on the organization, the benefits of templating can also be a deterrent. Kustomize does not ship with a lot of convention out of the box, staying tighter to a templating engine design. 

Potentially, the end-user can change anything in a base manifest without explicit templating code. By matching by a file, label, or annotation, the end-user has to have more detailed knowledge of what and where the change is going to take place. Poorly-crafted base YAMLs might not have easily accessible annotations/selectors to match the Kustomize files to. When compared to Helm, Kustomize is not a full ecosystem (e.g. a repository format itself) and relies on SCM, like a Git repository. 

What is Helm?

Helm is viewed as the de facto package management solution for the Kubernetes ecosystem. Package managers focus on installing and uninstalling software packages. Similar to YUM/RPM/APT in the Linux world, or using Homebrew/Chocolatey on your Mac/Windows machine respectively, Helm streamlines the software installation lifecycle. 

Helm was originally developed by Deis in 2015 and was showcased at the inaugural Kubecon. Helm is widely adopted by organizations and vendors alike as a mechanism to get software on and off a Kubernetes cluster. It is also a repository format, allowing for the rapid sharing/distribution of Helm resources. There are several open communities hosting Helm repositories, and vendors/projects can have specific Helm repositories. 

Helm Structure

Helm runs off a concept of Helm Charts and Helm Templates. When the Templates are combined with the values, the Templates will generate valid Kubernetes manifests based on the variables/values. 

Helm vs Kustomize

Helm Charts

A Chart is the primary format in which Helm runs off of. Since Helm Charts are file-based and follow a convention-based directory structure, Charts can easily be stored in Chart Repositories. Charts are installed and uninstalled into Kubernetes clusters. Like the image-to-container relationship, a running instance of a Chart is called a Release. In the end, a Helm Chart is an executed template converting Chart definitions to Kubernetes manifests.

Helm Charts, when created, must have a version number that follows semantic versioning. Helm Charts can reference other Charts as dependencies, a core to any package manager. More advanced features of Helm Charts are Chart Hooks and Chart Tests, which allow for interaction with a Release’s lifecycle, and the ability to run commands/tests against a Chart respectively.

Pros of Helm

Leveraging Helm has the same benefits that package managers had off the Kubernetes ecosystem. By allowing for an ecosystem and convention for users to create, share, and distribute instructions to install/uninstall software, consumption of the software certainly increases. 

Encompassing a convention and repository, creators of Helm Charts can enforce templates and standards on the consumers. DevOps or Platform Engineering teams can provide more completed Charts to the internal customers. 

Cons of Helm

A good amount of cons are directed towards Helm V2 and the introduction (and later removal in Helm V3) of Tiller. Tiller was a part of the Helm Platform. It came from the part of the project integration with Google’s Deployment Manager and was designed to be a job runner, not too dissimilar to Cloud Foundry’s Bosh. In a nutshell, Tiller is the in-cluster portion of Helm that runs the commands and Charts for Helm. Because Tiller had unfettered access to the Kubernetes Cluster, it became a sore point for cluster security.

Helm V2, up until one of the final renditions before Helm V3’s release, was storing secrets or sensitive information in Kubernetes ConfigMaps in plain text. This potentially made sense for internal uses of Helm, but as Helm Charts started to head to public repositories, this practice needed to change. 

Lastly, Helm can be overkill for simple deployments. The complexities that Helm brings in, along with being a release manager itself, is an additional layer of complexity to navigate. Because organizations want to standardize on how to deploy/release, migrating items that were easily accomplished without Helm into Helm, for consistency, is taxing. 

What Other Kubernetes Templating Tools Should I Look At?

Two main alternatives to using Kustomize or Helm are Jsonnett and Skaffold. 

Jsonnet/Ksonnet

Jsonnet is a templating language and engine. Jsonnett has an object-oriented approach for templating, allowing for complex and relationship-based templates to be created. If you need to make replicas of something, simply create a new object and the backing template will take over. Ksonnnet, created by Heptio, was a fork of Jsonnet specifically designed for Kubernetes. As of recently, the team behind Ksonnet no longer supports the project.  

Skaffold

Skaffold is one of the latest Kubernetes management projects from Google. Skaffold is more encompassing than Jsonnet, Helm, and even Kustomize. Since Skaffold has build and deploy components, it is designed to be the one recipe needed for a Kubernetes application. Skaffold is pluggable for the deployment phase with Helm and Kustomize.

Improve Kubernetes Deployments with Harness

No matter your choice in Kubernetes deployment/templating methodology, Harness has your back. Even if you are not an expert or you are designing pipelines to be leveraged by the entire organization, Harness makes that journey much simpler.

Harness Workflow Variables configuration with an Environments variable allowing dev and production values

Templating out Kustomize environments so users can pick which environment to deploy. 

Harness has wide support for Helm and Kustomize. Harness’ abstraction model allows both applications under templating control (e.g. a Helm or Kustomize deployment) and outside templating control to be deployed. 

Successful Hello Kustomize deployment in Harness, showing the visual pipeline execution graph and console logs

A successful Kustomize deployment with Harness.

Feel free to sign up for a Harness account and get started on - or supercharge - your Kubernetes journey!

Cheers,

-Ravi

← Previous:
Next: →

Related Resources

10 Signs You Don't Do Continuous Delivery

Continuous Delivery & GitOps

10 Signs You Don't Do Continuous Delivery

October 25, 2022

Eric Minick

+ more
Time to Read

While many of these development practices may feel commonplace, if you're doing these, you're not actually doing continuous delivery at all. Read on to learn 10 techniques that can help your team.

1. "Releases" Are Planned in Detail During “Agile” Meetings

Continuous delivery (CD) doesn't mean "intricately plan 12 releases for the entire year." Continuous deployments are never-ending, ongoing, nonstop, and so on. Agile was something dev teams aspired to achieve 10 years ago when monthly release cycles were considered valuable. Today, daily production deployments have become the norm. All the planning, meetings, approvals, tickets, and general politics associated with managing releases will actually slow you down or kill your business in today's world. 

In the year 2022, you don't want to be riding a horse when all of your competitors are driving cars.

2. You Don't Commit to Trunk

Branch, commit, merge,resolve conflicts – all tasks that slow you down. The whole point of CD is to deliver and deploy independent software components fast and frequently using dev teams that work in parallel.

If a build, test, or deployment pipeline fails, you should stop, understand what happened, fix it, and learn from it. This is what happens in production, so why not during development and testing? Committing to Trunk will drive the right team behavior and urgency required for CD.

3. Fixing Builds/Deployments takes 30+ mins

The whole point of a deployment pipeline is to kill your build before it causes production outages. When a deployment pipeline or test fails, it should be treated as a "stop-the-world" event where everyone stops, focuses, and fixes the build so things can progress. If your production canary or deployment fails, you should be able to roll back instantly or roll forward with a rapid fix.

We practice rapid rollbacks at Harness today. Bugs discovered by Harness are been fixed in minutes, not hours. Once, a bug was reported at 8:45am, and one engineer fixed the bug minutes later on her Caltrain journey to work. Shortly afterward, another developer pushed the fix while riding BART using his smartphone. 

4. Deployment Pipelines Take Hours to Complete

Let's imagine your new build or artifact is perfect. How long does it take for that artifact to be promoted through all your deployment pipeline stages (Dev, QA, Staging) and into production? One hour? Two hours? Six hours? Longer?

Feedback loops for deployment pipelines (and stages) need to happen in minutes, not hours. This may require more test/tool/feedback automation so you can eliminate manual tasks and approvals throughout your deployment pipelines. For example, if one pipeline stage succeeds, it should automatically move on to the next until a stage fails.

5. Your Deployments Rarely Fail in Testing

If 95% or your deployments succeed in dev/QA/staging, something is very wrong. Your deployment pipelines either lack basic test coverage or they lack integration with your existing toolsets. If you've already invested significant money in tools, why aren't you integrating and leveraging them to gain insight into your pipelines?

For example, many of our customers leverage APM (AppDynamics, New Relic, Dynatrace, etc.) and log analytics (Splunk, ELK, Sumo Logic, etc.) to help identify performance or quality regression in deployments. We call this continuous verification at Harness.

6. It Takes a Village to Deploy and Debug 

It's entirely possible you've automated your deployment process. By automated, I mean you've stitched together deployment scripts written by 20 different people, who, at some stage, tweaked and refactored a few hundred lines here and there.

So, when something breaks, it literally takes a village to debug and troubleshoot a deployment. We had one customer who described their previous deployment process as a "village exercise" that took 15 people six hours to debug.

Next time you deploy, count the number of people involved and multiply that number by how long the deployment process lasts. Village deployments are expensive and time consuming.

7. You Have a Dedicated Deployment/Release team

If you have multiple devs or product teams, the last thing you need is another team that bottlenecks all your deployments. Tickets, change control, approvals, handoff, documentation, and so on are more activities that slow down your deployment timelines.

If a deployment/release team does multiple deployments a day and the first deployment goes wrong, then they'll probably spend the next six hours debugging versus deploying, and thus bottlenecking other deployment pipelines. This just slows down your team’s ability to meet customer demands.

8. Developers Don't Deploy/Debug Their Own Code

Most well-oiled CI/CD organizations have their DevOps teams build deployment pipelines to use during deployment. Let me say that again: DevOps manages the tooling/automation/framework and developers use this platform-as-a-service so they can deploy their own code. We call this CD-as-a-Service at Harness.

When you let developers deploy their own code something natural happens:they end up debugging their own code should something fail. This is a very good thing. If code fails in production, then you need the right set of eyes, context, and knowledge to rapidly troubleshoot. You also need the ability to automatically roll back if you can't roll forward.

We hear too often from customers that Deployment/Release teams often drag DevOps or SREs teams into firefights when deployments go south.

9. You Don't Know the Business Impact of Deployments

The whole reason for doing CI/CD isn't so you can spend a ton of money on people, technology, and tools. You do it to grow your business and make it more competitive.

Organizations adopt CI/CD so their applications and services deliver a better service and experience than their competitors. End of story.

Let's imagine you spend $1 million a month on a new service for your business, and your team does daily production deployments. Do you know what positive impact each of those deployments had on your business? More importantly, do you know whether any deployments had a negative impact? If so, by how much? As Winston Churchill said, "No matter the strategy, it's always good to occasionally look at the results."

10. You think DevOps is CD

It's not. DevOps is a culture or mindset, whereas CD is a practice or set of principles that teams follow to deliver software safely, quickly, and in a sustainable manner. A DevOps culture makes CD principles easier to implement, but it's not going to magically re-architect your application so more components can be deployed more frequently in the cloud.

The vast majority of Harness customers are migrating from "vintage" monolithic applications to cloud-native microservices. CI/CD is a core initiative that is helping them make that transition. DevOps is a popular initiative, but this is more about people, culture, transparency, and collaboration across teams. It's not about tools or technology.

Adopt CD with Harness

These are 10 of the most common signs we see that indicate an organization isn’t properly utilizing CD. What other mistakes do you see other teams making?

If you’d like to hear more about how Harness can help your team implement CD, sign up for a free demo today!

Request a demo

Get Started

Get Started with Harness AI

Try the full platform free. No module restrictions, no credit card.

Ravi Lachhman
Director of Education
Ravi Lachhman builds the systems that help platforms scale.
ravi-lachhman
Ravi Lachhman
https://www.linkedin.com/in/ravilachhman/