How to create multiple values files inside helm chart?
Helm Chart is a very feature-rich framework when you are working with complex Kubernetes cluster and deployment. Helm chart provides a very convenient way to pass values.yaml
and use it inside your Helm Chart.
But for this article, we will focus on -
How to create multiple values files inside the helm chart?
Click on the blog post if you want to know more about How to pass environment variables inside your helm chart ?
Table of Content
- Create multiple values.yaml(e.g.
my-first-value.yaml
,my-second-value.yaml
) - Run Helm Install with multiple values.yaml
1. Create multiple values.yaml(e.g. my-first-value.yaml, my-second-value.yaml)
The first which we need to do is to create multiple values.yaml
. So I will be creating two files -
- my-first-value.yaml
- my-second-value.yaml
The aim of both files to increase the replica count of my helm chart. So I will be defining the attribute replicaCount
in both files.
Like I said we are trying to learn the concept here, but in your case, you can fill in any attribute as per your requirement into your values.yaml
1.1 Lets update my-first-value.yaml
As I said we are going to update the replica count, so first I am gonna put the replica count to 2
1replicaCount: 2
You must save the file before closing it.
1.2 Secondly update my-second-value.yaml
In this file, we are going to increase the replica count to 3
. Although we are using the same attribute in both the files but you can insert some different attribute values based on your business need.
1replicaCount: 2
2. Run Helm Install with multiple values.yaml
Now we have created multiple values.yaml .i.e. - my-first-value.yaml, my-second-value.yaml
, its time to use both the files inside your helm install
command.
Here the command for installing the helm chart using multiple values.yaml
1helm install -f my-first-value.yaml -f my-second-value.yaml helloworldrelease helloworld
How to understand the command?
helm install
- You need to use this because you are trying to install the helm chart-f my-first-value.yaml -f my-second-value.yaml
- This is how we pass multiple value.yaml inside helm install commandhelloworldrelease
- It is a release name that can anything of your choicehelloworld
- Your actual helm chart name.
Conclusion
Hope this article helps you to build your understanding around using multiple values.yaml
For more similar discussion you can read more from the following threads -
Read More -
- Helm chart - How to Add/Install plugins
- Getting started with Helm Chart
- Helm chart - WordPress Installation with MariaDB on Kubernetes
- Helm chart - Build you first helm chart with Spring Boot
- Helm Chart - Convert Kubernetes YAML into Helm Chart YAML
- Helm Chart - Pass environment variables
- Helm Chart - Plugin
- Helm Chart - Dry Run Install
- Helm Chart - How to create multiple values files inside helm chart?
- Helmfile - How to use Helmfile for managing helm chart?
Posts in this Series
- How to use Helmfile for managing helm chart?
- How to create multiple values files inside helm chart?
- Pass environment variables into Helm Chart?
- How to fix - Helm install unknown flag --name/Error must either provide a name or specify --generate-name?
- Understanding Helm dry run for template debugging
- How to fix - Error create failed to create Secret invalid metadata.name Invalid value DNS-1123 subdomain must consist of lower case alphanumeric characters - or ., and must start and end with an alphanumeric character (e.g. example.com, regex used for validation is)
- Convert Kubernetes deployment YAML into Helm Chart YAML
- Helm chart - Wordpress Installation with MariaDB on Kubernetes
- Helm chart - How to Add/Install plugins
- Getting Started with Helm Chart
- Building first Helm Chart with Spring Boot Microservices