Helm is a popular package manager for Kubernetes that helps you to manage your applicationâs deployment in a better way. Helm allows you to define, install, and upgrade Kubernetes applications. One of the essential features of Helm is the Helm Upgrade command, which allows you to update your charts with new values without modifying the chart's template.
In this article, we will discuss the Helm Upgrade command and how to update chart values with some examples.
Understanding Helm Upgrade Command
Helm Upgrade is a command that updates your chart with new values. The new values are applied to the chart's templates and then deployed to the Kubernetes cluster. The command also creates a new revision of the release.
Syntax:
The syntax for the Helm Upgrade command is as follows:
helm upgrade [RELEASE] [CHART] [flags]
Here,
[RELEASE]
is the release name of the application you want to update.[CHART]
is the chart's name you want to update.[flags]
are any additional flags that you want to provide.
Updating Chart Values
To update the chart values, you need to create a values.yaml file and specify the new values. You can update any of the values specified in the values.yaml file.
Step 1: Create a values.yaml file.
image:
repository: nginx
tag: 1.21.1
replicaCount: 3
service:
type: LoadBalancer
port: 80
Step 2: Update the values in the values.yaml file.
For example, if you want to update the tag of the image, you can change it to the following:
image:
repository: nginx
tag: 1.22.1
replicaCount: 3
service:
type: LoadBalancer
port: 80
Step 3: Run the Helm Upgrade command.
helm upgrade myapp ./mychart --set-file values.yaml
In this example, myapp
is the release name of the application, and mychart
is the chart name.
The --set-file
flag tells Helm to use the values.yaml file to update the chart values.
More Examples
You can also update chart values using the --set
flag.
For example, if you want to update the replica count, you can use the following command:
helm upgrade myapp ./mychart --set replicaCount=5
This command updates the replica count to 5.
If you want to update multiple values, you can use the following command:
helm upgrade myapp ./mychart --set replicaCount=5,image.tag=1.22.1
This command updates the replica count to 5 and the image tag to 1.22.1.
The Helm Upgrade command is a powerful feature that allows you to update your application's chart values without modifying the chart's template. In this article, we have discussed how to update chart values with examples. We hope that this article has helped you to understand the Helm Upgrade command and how to use it.
Related Searches and Questions asked:
That's it for this post. Keep practicing and have fun. Leave your comments if any.