Managing Helm Charts with Ease in Code Repositories

Vivek Kumar
Globant
Published in
5 min readMay 19, 2023
Photo by Praveen Thirumurugan on Unsplash

Managing Helm charts for many components in a code repository can be complex but can be simplified with the right approach. In this article, we will cover the best practices for effectively managing Helm charts in a GitHub code repository. We aim to address the challenges that arise when managing dependencies and releases for multiple components. Ultimately, our goal is to simplify the management of dependencies, releases, and deployments.

In this article, we will discuss various methods for organizing Helm charts in a code repository, considering essential factors such as the number and complexity of components, the release process, and the implementation of CI/CD.

Some Concepts

Helm is commonly used with Kubernetes to manage applications on a cluster. A Helm chart defines an application or service’s configuration in a set of files.

A component is a part of an application or service with a specific function. For instance, a web app may have a front-end component that users interact with. Also, a back-end component that handles data processing. Each component can have its own Helm chart, with its configurations and deployment.

Approaches that one can follow

There are different options available for organizing Helm charts in code repositories:

  • Separate repository for each component
  • Use a unified repository for all components
  • Use one repository with subdirectories

Separate repository for each component

One popular approach is to adopt a separate repository for each component. Using a separate repository enables the versioning and releasing of each chart, thus, allowing for greater control over individual releases. This approach can be useful if different teams are responsible for different charts. Or if charts have different release schedules. But, this method can create difficulties when managing dependencies between the components.

An example of using this approach could be an e-commerce site with components like a catalog, cart, and checkout. Maintaining them in separate repositories enables easy management and isolation of each element, but managing interdependencies between the components can be challenging. The following diagram shows this approach:

Separate repository for each component with separate helm charts

Use a unified repository for all components

Another option is to use a unified repository to house all website components. This approach simplifies managing dependencies between features. But, it can present difficulties when isolating and addressing individual components.

An example using this approach could be a company that adopts a shared repository to store its website components. In this scenario, managing dependencies between components become more streamlined, but working on individual components isolated from each other could pose a challenge. The following diagram shows this approach:

Single repository for all components with separate helm charts

Use one repository with subdirectories

Another way to organize Helm charts is to use one repository with subdirectories. This approach uses a single repository and categorizes them into subdirectories. This allows for straightforward management and isolation of each component. Moreover, it simplifies managing dependencies between components, making the entire system more manageable.

An example using this approach could be a consolidated repository to manage e-commerce website components, like catalog and cart. Such an arrangement streamlines component management and facilitates individual component control. Also, it simplifies dependency management by keeping all the components in one place. The following diagram shows this approach:

Single repository for many components with Parent-Child(chart-Sub chart) Helm charts

The Role of CI/CD

CI/CD tools are essential in deciding how to structure the repository for Helm charts. They automate the testing and deployment of the charts. A well-structured repository makes it easier to integrate them.

Suppose we are using a single pipeline for deploying all helm charts. Then, using the single repository with a subdirectories approach would be the best option for this use case. The pipeline can then trigger builds and deployments for each subdirectory. This makes it easier to integrate and deploy new code changes.

Another use case could have different pipelines for each component. In this case, having separate repositories for each component may be more suitable. This usually happens if different teams are working on each component. This enables each team to work and makes it easier to integrate their code.

Conclusions

Deciding the repository structure for Helm charts of different components can be a challenging task, but it doesn’t have to be overly complex. It’s essential to consider factors such as the number of components, their complexity, and the release process. Based on these considerations, there are various approaches you can adopt.

One option is to organize your Helm charts by having separate folders for each component within a single repository. This allows for a consolidated view of all the charts while maintaining separation between the components. Alternatively, you can opt for separate repositories with individual folders for each component. This provides a more granular organization, making it easier to manage and version control each component separately. Another possibility is to gather all the Helm charts into one comprehensive folder within a repository. This simplifies the repository structure but may require careful organization and documentation.

Regardless of the chosen approach, leveraging CI/CD tools is crucial. These tools can greatly assist in managing the repository, automating the testing and deployment of Helm charts, and ensuring a streamlined workflow. A well-organized repository structure makes it easier to test and deploy your Helm charts, ultimately enabling you to focus on what truly matters: creating outstanding applications and services.

References

Helm documentation.

--

--

Vivek Kumar
Globant
Writer for

Harmonizing DevOps and cloud 🎵 | Orchestrating digital symphonies 🎶 | Automating with a touch of magic ✨