When working with Kubernetes Helm, you might find yourself in a situation where you need to retrieve values from an installed chart. Helm, a package manager for Kubernetes, allows you to define and manage application resources through simple YAML files, and understanding how to extract values from an installed chart is a crucial part of this process.

In this article, we will guide you through the process of getting values from an installed chart using Helm. We will cover the basics of Helm charts, explain how to retrieve values, and provide examples to illustrate the process. By the end of this guide, you will be able to efficiently manage your application's configuration using Helm.

Understanding Helm Charts
Before diving into retrieving values, let's quickly recap what Helm charts are. A Helm chart is a collection of files that describe a related set of Kubernetes resources. A typical chart consists of a Chart.yaml file, a values.yaml file, and templates for various Kubernetes resources like deployments, services, and ConfigMaps.

The values.yaml file is where you define the default values for your chart. You can override these values when you install or upgrade the chart. This file, along with any custom values you provide, forms the chart's configuration.
Chart Configuration Files

Charts often come with a default configuration file called values.yaml. This file contains the default settings for the chart, which can be overridden during installation or upgrade with a custom values file.
The syntax of these configuration files is simple and follows the YAML format. It's a hierarchical structure of keys and values where keys can have values of various data types, including strings, numbers, booleans, lists, and objects.
Defining and Using Values

Here's a simple example of what a values.yaml file might look like:
apiVersion: v1
name: MyApp
image:
repository: myreg.example.com/myapp
tag: v1.0.0
service:
type: LoadBalancer
port: 80
In this example, 'name' and 'image' are defined as top-level keys, while 'service' is an object containing more specific settings for the service.
Retrieving Values from an Installed Chart

Now that we've covered the basics of Helm charts, let's move on to how you can retrieve values from an installed chart. Helm provides a built-in feature to fetch the values of a specific release or all its values.
Let's start by finding out the name of the release you want to inspect. You can use the `helm list` command to list all your installed releases:









$ helm list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
my-app .contoso.com 1 2022-03-01T12:00:00Z deployed bob-helm-chart 1.0.0
Fetching Values for a Specific Release
Now that you have the release name, you can use the `helm get values` command to retrieve its values. Here's an example:
$ helm get values my-app -n contoso.com
image:
repository: myreg.example.com/myapp
tag: v1.0.0
service:
type: LoadBalancer
port: 80
The `-n` or `--namespace` flag specifies the namespace where the release is installed. If you don't provide this flag, Helm will search in all namespaces.
Fetching Values for All Releases
If you want to fetch values for all releases, you can use the `-A` or `--all-namespaces` flag with the `get values` command:
$ helm get values -A
This command retrieves the values for all releases in all namespaces.
With this knowledge, you can efficiently manage your application's configuration using Helm. By understanding how to retrieve values, you can quickly inspect and modify your chart's configuration as needed.