Ever found yourself needing to extract specific values from Helm, the package manager for Kubernetes? You're not alone. In this guide, we'll delve into the intricacies of using Helm to pinpoint and retrieve precise values from your charts.

Before we dive in, let's ensure we're on the same page. Helm is an organized way of handling your Kubernetes resource configurations. It uses a packaging format called charts, which define complex applications in a repeatable way.

Understanding Helm Values
In Helm, values are a core part of the chart. They allow you to customize the installation of a chart without having to modify the chart's code. In essence, values help you tune your application to fit your specific environment.

Values are defined as key-value pairs in a file named values.yaml in the root of a chart. They can be overridden or supplemented at various levels - chart, release, and command line - offering great flexibility.
The Repository of Values

A chart's default values are stored in the values.yaml file. This file provides a template for the values that will be used if no other values are specified. For instance, a chart might have a replicaCount value set to 3 by default:
replicaCount: 3
However, you can override this value while installing the chart.
Overriding Default Values

You can specify new values or override existing ones when you install a chart. This is done using a values file. You can provide a values file directly, like so:
helm install my-release /path/to/my/chart --values my-values-file.yaml
Or you can provide values on the command line, like this:

helm install my-release /path/to/my/chart -f my-values-file.yaml --set replicaCount=5
Retrieving Specific Values









Now, let's get to the meat of the discussion - retrieving specific values. Helm provides a command to get the values for a particular release:
helm get values RELEASE_NAME
This command will output the fully resolved values for the release, including default values, any values override files, and command line overrides.
Getting Values with a Template
Sometimes, you might want to retrieve values in a templated form. This is useful when you want to see how the values would be rendered by the chart's templates. To do this, you can use the --template flag:
helm get values my-release --template "${replicaCount}"
Getting Values as JSON
If you're working with scripts or APIs, it might be helpful to get the values in JSON format. You can do this with the --output flag:
helm get values my-release --output json
The command will return the fully resolved values in JSON format.
In the end, understanding how to extract specific values from Helm is a powerful skill. It allows you to customize your applications, debug issues, and even script Helm operations. So, the next time you find yourself needing to get a specific value, you'll know just what to do. Happy Helm-ing!