logo
Menu
Installing multiple helm charts in one go using parent-child(dependent) charts

Installing multiple helm charts in one go using parent-child(dependent) charts

Installing multiple helm charts in one go using a single command, in this article we will go through one of the approaches to accomplish this.

Published Dec 11, 2023
Last Modified Jul 24, 2024
Helm is really a very powerful tool for managing Kubernetes objects and is widely adopted across all kinds of organizations. It is truly a game changer on how Kubernetes objects are being managed.
With a single command we can install or upgrade multiple related Kubernetes entities together, we need not to worry about how the resources will be created, Helm will do all the heavy lifting for us.
But below post is not about the basics of helm or how to install or upgrade a chart, etc. It's about some new ways of getting charts deployed.
Let's say you have a requirement for getting more than 100 charts installed on a specific Kubernetes cluster, what would you do in this scenario?
On top of my head, I can think of couple of approaches:
Prerequisites:
  • A running Kubernetes cluster with proper permissions, here I have used minikube.
  • kubectl and helm installed on your machine to interact with the Kubernetes cluster.
    • Ref: https://kubernetes.io/docs/tasks/tools/
    • Ref: https://helm.sh/docs/intro/install/
Approach 1:
Club inter-related charts into one, as in get a parent/wrapper chart created which will in turn have the related child charts as dependency. Which mean if we install the parent/wrapper chart it will get all the Kubernetes resources of all the child charts deployed (provided they are marked as enabled in Chart.yaml).
Below is a quick example, wherein I have a 3-Tier application named app01.
  • If you notice the output of both the commands in parent's Chart.yaml I have all three charts listed as dependencies and in the other one, individual charts have its own Kubernetes resources.
_
  • When we install the parent chart it will get all the Kubernetes resources deployed.
_
_
  • Another thing to note here is now we have 4 values.yaml files (one for each child chart and one for parent helm chart).
  • And the good part here is using just one parent's values.yaml file we can manage all 3 of them.
  • Make sure in parent's values.yaml, child chart's values are indented correctly, and they are indented under specific chart name as mentioned in Chart.yaml under .dependencies[*].name
  • Here we are just updating the replicaCount of all child charts and are upgrading the release.
  • As specified in parent chart values.yaml, the replicaCount is now increased to 2,3 respectively.
  • As you see here with a single command, we deployed multiple helm charts and using a single values.yaml file we have the ability to manage all of them.
Approach 2:
Using helmfile.
Approach 3:
Using bash or any other scripting language (I am planning to write a simple utility to accomplish this).
Further, I am in a process of writing another article around Approach 2 and 3, plus there can be multiple other approaches for getting this accomplished (feel free to share your thoughts and comments).
PS: The cover image is created using https://www.canva.com/
Happy learning :)
 

Comments