Skip to main content

Packaging a Helm Chart for a Release

This topic describes how to package a Helm chart and the Replicated SDK into a chart archive that can be added to a release.

Overview

To add a Helm chart to a release, you first add the Replicated SDK as a dependency of the Helm chart and then package the chart and its dependencies into a .tgz chart archive.

The Replicated SDK is a Helm chart can be installed as a small service alongside your application. The SDK is strongly recommended because it provides access to key Replicated features, such as support for collecting custom metrics on application instances. For more information, see About the Replicated SDK.

Chart Version Requirement

The chart version in your Helm chart must comply with image tag format requirements. A valid tag can contain only lowercase and uppercase letters, digits, underscores, periods, and dashes.

The chart version must also comply with the Semantic Versioning (SemVer) specification. When you run the helm install command without the --version flag, Helm retrieves the list of all available image tags for the chart from the registry and compares them using the SemVer comparison rules described in the SemVer specification. The version that is installed is the version with the largest tag value. For more information about the SemVer specification, see the Semantic Versioning documentation.

Package a Helm Chart

This procedure shows how to create a Helm chart archive to add to a release. For more information about the Helm CLI commands in this procedure, see the Helm Commands section in the Helm documentation.

To package a Helm chart so that it can be added to a release:

  1. In the Helm chart Chart.yaml, add the Replicated SDK as a dependency:

    # Chart.yaml
    dependencies:
    - name: replicated
    repository: oci://registry.replicated.com/library
    version: 1.0.0-beta.14

    For the latest version information for the Replicated SDK, see the replicated-sdk repository in GitHub.

    For additional guidelines related to adding the SDK as a dependency, see Install the SDK as a Subchart in Installing the Replicated SDK.

  2. (Recommended) Log out of the Replicated registry:

    helm registry logout registry.replicated.com

    Replicated recommends that you log out of the Replicated registry to avoid errors that can occur when Helm attempts to pull the SDK chart from the registry if you are logged in with a license that has expired.

  3. Update the charts/ directory:

    helm dependency update
  4. Package the Helm chart into a .tgz archive:

    helm package .

    The Helm chart, including any dependencies, is packaged and copied to your current directory in a .tgz file. The file uses the naming convention: CHART_NAME-VERSION.tgz. For example, postgresql-8.1.2.tgz.

  5. Add the .tgz chart archive to a release. See Managing Releases with the Vendor Portal or Managing Releases with the CLI.

After the release is promoted, your Helm chart is automatically pushed to the Replicated registry. For information about how to install a release with the Helm CLI, see Installing with Helm.