Introduction
Helm templates provide a built-in Values object for accessing Helm chart values. The changes in Helm values are stored with every update.
Comparing versions of Helm values and reviewing old releases is good practice for keeping track of changes.
This article explains how to get Helm Values for a Helm release.
Prerequisites
- Access to a CLI.
- Minikube cluster running (Follow our guides How to Install Minikube on Ubuntu or How to Install Minikube on CentOS).
- Added Helm repository (Follow our guide How to Add, Update or Remove Helm Repositories).
Get Helm Values
To get values from a Helm release, use:
helm get values <release name>
For example:
helm get values phoenix-chart
The output prints the user-supplied values for the current Helm release in YAML format:
The user-supplied values are set when deploying a Helm chart. The set values override computed values.
Get Computed Values
Get computed values for a Helm release with:
helm get values <release name> -a
Or alternatively:
helm get values <release name> --all
For example:
helm get values phoenix-chart -a
The output prints the computed values for the current Helm release in YAML format:
When there are no user-supplied values, the computed values are pulled from the template to show a default value.
Get Values from a Previous Revision
Helm releases usually have multiple revisions. The values from any previous revision are all stored as revisions.
To get values from a previous revision of a Helm release, use:
helm get values <release name> --revision <release number>
For example, to get the values from the first revision:
helm get values phoenix-chart --revision 1
Get Values Output Format
The output is in the YAML format by default. Display the output in a specified format with:
helm get values <release name> -o <data format>
Available data formats are:
- Table
- JSON
- YAML (default)
For example, to get values of a helm release from the first revision in JSON format, use:
helm get values phoenix-chart --revision 1 -o json
Conclusion
A Helm release has Values stored with the initial release. As newer releases get deployed, the values of a Helm chart change. Using the helm get values
command downloads the Values file for a specified release.
Once you review the revisions, you may decide to start from scratch or rollback to a past revision. To help you do it easily, read our articles on how to roll back changes in Helm and how to create a Helm chart next.
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/223915.html