0

I'm currently using Ansible to template out Helm values files and deploy Helm charts to Kubernetes. However, this happens in sequence and generally takes a long time to deploy because of the number of Helm charts needed to deploy. I'm looking for a way to deploy Helm charts in parallel.

A few of my Helm charts depend on each other, but many of the charts could be deployed in parallel. There are also instances where I want to conditionally decide to deploy a Helm chart before another chart. For example, sometimes (but not always) I want to run a database migration Helm chart to completion before running an application helm chart. Also, sometimes, I want to deploy the entire suite of Helm charts all at once and sometimes I just want to deploy a particular chart or subset of charts without impacting other deployed charts.

I was wondering if there are any projects or tooling around deploying Helm charts in parallel, while setting dependencies and conditionals.

I've encountered the Helmfile project, which looks interesting. However, it's not clear to me if this project supports parallel execution and dependent execution.

Has anyone encountered a similar need and found a tool that works for conditionally deploying Helm charts in parallel? Or has anyone leveraged Helmfile to achieve this?

Joe J
  • 9,985
  • 16
  • 68
  • 100
  • 1
    You can split helm charts into different roles and then use pararellism to execute those roles. – Klevi Merkuri Apr 24 '23 at 22:04
  • 1
    Helmfile supports dependencies (`needs:`) and can install charts in parallel. You don't really need to do anything special for parallel support beyond setting it up. But, Helmfile _only_ installs Helm charts (with some ability to run extra hooks, but it is not a generic automation tool), and its ability to use Helm templating in the `helmfile.yaml` file can add complexity. – David Maze Apr 25 '23 at 01:24
  • Thank you for the responses. Good idea about creating ansible roles for each chart with parallelism. The `needs:` parameter looks promising as well. – Joe J May 05 '23 at 20:55

1 Answers1

1

I use Helmfile for my projects. While I don't use the --concurrency flag, because my charts are specifically ordered, helmfile is VERY powerful. It seems from the githubs people use bases: in helmfile to establish their parallel charts, and everything that is ordered in the releases.

Also if your individual charts have dependencies, you can specify those in the chart.yaml to simplify your releases and then just do everything in parallel without further complicating the helmfile project.

Derek Williams
  • 525
  • 6
  • 21
  • Thank you for sharing your experience with Helmfiles. I'll take a closer look at them and at the --concurrency flag that you mention. I was hesitant to put certain dependencies in chart.yaml because they are conditional. For example, sometimes I want to deploy a JUST database migration helm chart, sometimes I want to deploy JUST an application helm chart, and sometimes I want to deploy the migration helm chart THEN the application helm chart. – Joe J May 05 '23 at 20:53
  • It sounds like you need to solve this issue with a series CICD pipelines rather than helm charts or helmfile itself. All the permutations are going to create messy, unsupportable code. – Derek Williams May 10 '23 at 19:40