Helm Chart Kubernetes Deployments

3 years ago   •   7 min read

By Abhinav Dubey
In this article

In the dynamic landscape of Kubernetes, managing applications and their myriad configurations can become a complex endeavor. Enter Helm, a potent package manager for Kubernetes, with Helm charts at the core of its utility. This article delves into the essence of Helm charts, underscores their widespread adoption, evaluates alternatives, and conducts a comparative analysis to spotlight the advantages and disadvantages between Helm charts and their alternatives.

What Are Helm Charts?

Helm charts are a collection of YAML files that describe a related set of Kubernetes resources, including metadata, configuration files, and templates for creating Kubernetes deployments. A chart may encompass all necessities for running a web server, a database, and the backend services required by an application, bundling these specifications alongside a default configuration into a singular, manageable entity. Charts simplify the Kubernetes application deployment process, enabling users to employ simple commands for installation, upgrade, and management.

Key Features:

  • Simplification: Abstracting the complexity of deploying applications on Kubernetes, transforming a multi-step operation into a straightforward command line (CLI) instruction.
  • Versioning and Rollbacks: Support for versioning with Helm charts facilitates easy rollbacks to previous versions of an application, leveraging helm rollback commands for efficient management.
  • Template Engine: With the built-in template engine, users can customize installations via the values.yaml file without modifying the chart itself, promoting reuse across various environments.
  • Dependency Management: Charts can specify dependencies on other charts or docker images, automating the deployment of complex applications and microservices.

Why People Use Helm Charts

The allure of Helm charts for Kubernetes users lies in their ability to streamline application deployment and management:

  • DevOps Workflow Integration: Seamlessly integrates into CI/CD pipelines, enhancing DevOps practices by automating helm deployments through commands like helm install and helm upgrade.
  • Comprehensive Management: From helm repo addition to helm release tracking, charts provide a unified approach to managing lifecycle events, including upgrades and rollbacks, with detailed documentation available through helm docs.
  • Community and Support: Helm's strong community contributes to a vast helm repo on GitHub, offering extensive resources, tutorials, and support for new and experienced users alike.

Alternatives to Helm Charts

While Helm charts reign supreme for many, alternatives exist catering to specific needs and preferences:

  1. Devtron’s Helm Chart Store: Centralizes helm repo management, enhancing operational efficiency and application delivery consistency across Kubernetes environments.
  2. Kustomize: Offers a declarative approach to configuration, focusing on customization of Kubernetes objects without the overhead of templating.
  3. Terraform: An infrastructure as code tool supporting Kubernetes, allowing users to manage a wide array of resources across service providers like Azure.
  4. Pulumi: Enables infrastructure definition using general-purpose programming languages, presenting an alternative approach to Kubernetes resource management.
  5. Ansible: Renowned for its simplicity, Ansible manages Kubernetes resources with ease, appealing for its agentless architecture and automation capabilities beyond Kubernetes.

Comparative Analysis: Helm Charts vs. Alternatives

Helm Charts

Pros:

  • Integrated package management simplifies application deployment and management.
  • Templating and configuration management are built-in, offering flexibility.
  • Strong community support and a large repository of existing charts for common applications.

Cons:

  • The templating syntax can be complex for newcomers.
  • Over-reliance on charts for simple tasks can sometimes complicate matters.

Kustomize

Pros:

  • Leaner, more focused on configuration customization without additional templating.
  • Integrated into kubectl, requiring no additional tools.
  • Encourages a more declarative approach to application configuration.

Cons:

  • Limited in scope compared to Helm, focusing on customization over package management.
  • Can require more boilerplate for complex deployments.

Terraform and Pulumi

Pros:

  • Broad infrastructure management capabilities beyond Kubernetes.
  • Infrastructure as code approach appeals to users seeking consistency across environments.

Cons:

  • Learning curve and complexity can be higher due to broader scope.
  • May provide more functionality than needed for Kubernetes-only deployments.

Ansible

Pros:

  • Simplicity and readability of playbooks.
  • Strong community and wide adoption in automation beyond Kubernetes.

Cons:

  • Lacks some of the Kubernetes-specific features and optimizations found in Helm.
  • Can be slower for complex deployments due to its agentless nature.

Helm Client and Important Commands

The Helm client is a command-line interface (CLI) tool that users interact with to manage Helm charts and their deployments on Kubernetes. It acts as the primary interface for executing various Helm commands to manage Kubernetes applications.

It processes the commands issued by the user, such as installing, upgrading, rolling back deployments, or packaging Helm charts. The Helm client communicates with the Helm library to execute these commands, which in turn interacts with the Kubernetes API.

Helm Package

  • Command: helm package
  • Functionality: This command packages a Helm chart into a chart archive (a .tgz file). It collects all the files and directories within a chart directory, compresses them, and creates a versioned chart archive. This command is essential for chart distribution and versioning.
  • Relationship: The helm package command is used by chart developers to prepare a chart for distribution. Once packaged, the chart can be distributed via Helm chart repositories or directly to users. The Helm client utilizes this packaged chart for deployment.

Helm Install

  • Command: helm install
  • Functionality: This command is used to deploy a Helm chart onto a Kubernetes cluster. It reads the specified chart (either from a local directory, a .tgz package, or a chart repository), processes the configuration options provided by the user, and then deploys the resulting set of Kubernetes resources to the cluster.
  • Relationship: After a chart is packaged with the helm package command, it can be installed using the helm install command. The Helm client interprets the command, processes the chart and its configurations (values), and manages the deployment process to Kubernetes.

Helm Template

  • Command: helm template
  • Functionality: This command renders the chart templates locally and displays the output. It allows users to see the generated Kubernetes manifest files without actually deploying them to a cluster. This is useful for debugging or for understanding what resources will be created or modified.
  • Relationship: The helm template command can be used as a preliminary step before helm install to verify what Kubernetes resources will be deployed. It leverages the same chart packaging managed by the helm package command but doesn't require interaction with a Kubernetes cluster for its execution. It provides a way for users to inspect or audit the deployment manifests for correctness or compliance before actual deployment.

Overview of the Workflow

The workflow typically starts with chart developers using helm package to prepare and version their charts. Users, then, can use the Helm client to execute the helm install command to deploy these packaged charts onto their Kubernetes clusters. Before installation, users might opt to run helm template with their chart to preview the Kubernetes resources that will be created without making any changes to their cluster. This entire process underscores Helm's capability to streamline Kubernetes application deployment and management through an integrated set of tools and commands.

How to Make Helm Deployments Ridiculously Easy With Devtron

Building a Helm chart and managing it, are two different aspects of packaging an application for Kubernetes. Helm is efficient enough to package a complex K8s application and deploy it. When it comes down to app management, there are certain challenges with Helm. In this short example, we will see how easy it is to deploy and manage a custom mongodb chart using Devtron.

So, let’s get started.

Note: The only prerequisite of getting started with Devtron is to have a Kubernetes cluster

Adding Helm repository

Devtron comes with a number of pre-added, commonly used Helm charts that can be seen in the `Charts` section. But if you want to install your custom chart, let's say MongoDB, it can be easily achieved using Devtron.

To add any custom chart, go to Global ConfigurationsChart RepositoryClick on Add RepositoryClick Save  → Click on Refresh Charts

Note: If you do not see any charts in Charts section, click on Refresh Charts to sync all the charts from added repositories

Deploying Helm charts

Now that we have added our custom chart repository i.e, percona, let’s deploy it.

To deploy any chart through Devtron, goto ChartsClick on Chart to DeployClick Deploy  → Change Values as per requiredClick Deploy Chart.

For instance, I want to deploy Percona's MongoDB operator. Let’s see how we can deploy it with just a few clicks.

Step-1: Select the chart to deploy i.e, percona/psmdb-operator

Step-2: Click on Deploy to edit default values as per your requirements

Step-3: Edit the default configuration and click on Deploy Chart. You can also see the description for all the parameters, from the sidebar - README of the particular chart.

Step-4: Congratulations, you have successfully deployed! You can see all the details of your deployed chart such as current status, different workloads, manifests, events, logs, deployment history, etc within Devtron dashboard itself.

Conclusion

Choosing between Helm charts and alternatives boils down to specific project requirements, preferences, and infrastructure. Helm offers a robust, feature-rich platform ideal for managing complex Kubernetes applications, supported by a comprehensive ecosystem of tools and community resources. For those seeking simplicity and integration within DevOps workflows, Devtron's Helm Chart Store presents an attractive alternative, streamlining application deployment and management in Kubernetes environments.

Reach out to us through the Discord channel and refer to Devtron documentation, to find all the features of Devtron.

If you'd like to continue learning more about Helm, read this blog post on the changes made to Helm 3.

Related articles

Spread the word

Keep reading