✦ For everyone, free.

Practical knowledge for real and everyday life

Home

Release Listing and Filtering

Helm's Release Listing and Filtering helps manage Kubernetes deployments by enabling search, sort, and filter options across clusters.

Release Listing and Filtering refers to the process of retrieving and managing the list of Helm releases deployed in a Kubernetes cluster, with the capability to apply various filtering criteria to selectively view or operate on those releases. This functionality is essential for administrators and operators to efficiently track, audit, and manipulate Helm releases, especially in environments with many charts and namespaces.


Understanding Release Listing in Helm

Helm releases represent instances of a chart deployed to Kubernetes. Each release has metadata such as the release name, namespace, revision number, status, and chart version. The Helm CLI and Helm SDK enable users to list these releases to gain insights into their current state.

The basic command to list releases is:

helm list

By default, this lists all releases in the current namespace, showing details like:

  • NAME: The release name
  • NAMESPACE: Kubernetes namespace of the release
  • REVISION: Number of times the release has been upgraded
  • UPDATED: Timestamp of the last update
  • STATUS: Current status (e.g., deployed, failed, pending)
  • CHART: Chart name and version
  • APP VERSION: Version of the application deployed

Filtering Releases

Filtering allows users to narrow down the list of releases based on specific conditions, improving manageability in clusters with numerous releases.

Namespace Filtering

To list releases in a specific namespace, use:

helm list --namespace my-namespace

This confines the output to releases only within the specified namespace.

Status Filtering

Helm supports filtering releases by their status using the --filter flag combined with status criteria, or the --status flag.

Statuses include:

  • deployed: Successfully deployed releases
  • failed: Releases that failed to deploy or upgrade
  • pending: Releases in progress or waiting
  • uninstalled: Releases that have been uninstalled but still tracked
  • superseded: Older releases replaced by newer ones

Example listing only deployed releases:

helm list --status deployed

Multiple statuses can be combined as a comma-separated list:

helm list --status deployed,failed

Name-Based Filtering

The --filter flag accepts a regular expression to match release names:

helm list --filter "^prod-"

This lists all releases whose names start with "prod-".


Advanced Filtering and Output Control

Combining Filters

Filters can be combined for more precise queries. For example, to list all deployed releases in a specific namespace with names matching a pattern:

helm list --namespace staging --status deployed --filter "webapp-.*"

Output Formatting

Helm allows output in table (default), JSON, or YAML formats for integration with scripts or tools:

helm list --output json

This is useful for programmatically parsing release data.


Programmatic Release Listing via Helm SDK

Beyond the CLI, Helm provides SDK interfaces for release listing and filtering. This is useful in building custom tooling or dashboards.

Using the Helm Go SDK

The action.List client can list releases with options for namespace, status filter, and name filter.

Example snippet:

actionConfig := new(action.Configuration)
client := action.NewList(actionConfig)
client.Namespace = "default"
client.Statuses = []release.Status{release.StatusDeployed}
client.Filter = "^prod-"

releases, err := client.Run()
if err != nil {
    // handle error
}
for _, r := range releases {
    fmt.Println(r.Name, r.Namespace, r.Info.Status)
}

This programmatically retrieves releases matching filters, enabling automation.


Practical Use Cases of Release Listing and Filtering

  • Cluster Auditing: Quickly identify all failed or pending releases to troubleshoot issues.
  • Deployment Management: List only deployed releases in a namespace for operational insight.
  • Automation Scripts: Use filters combined with JSON output to integrate with CI/CD pipelines.
  • Monitoring and Alerts: Programmatically monitor release statuses and trigger alerts on failure.
  • Cleanup Operations: Find uninstalled or superseded releases to clean up Helm history.

Summary of Key Helm List Flags for Filtering

FlagDescriptionExample Usage
--namespaceLists releases in a specific Kubernetes namespacehelm list --namespace prod
--statusFilters releases by status (deployed, failed, etc.)helm list --status failed
--filterRegular expression to filter release nameshelm list --filter "^test-"
--outputFormat output as table (default), json, or yamlhelm list --output json

Release Listing and Filtering in Helm is a foundational operation that empowers users to view, query, and manage Helm releases effectively. By leveraging namespace, status, and name-based filters, combined with flexible output options and SDK integration, operators can maintain strong control over application deployments in Kubernetes environments.