Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
ArtifactsRegistry TypesGetting Started

Helm OCI

Create a Helm OCI registry, generate an identity token, then push and pull Helm charts over the OCI protocol with the Helm CLI, version 3.8 or later.

Use a Helm OCI registry to push and pull Helm charts over the OCI protocol with the Helm CLI.

What you will learn from this topic

In this quickstart, you will:

  • Create a registry in Harness Artifacts.

  • Publish a package to the registry.

  • Install the package from the registry, and confirm the working.

Before you begin

  • Install the Helm CLI (helm) version 3.8 or later on your local machine. OCI support is enabled by default in these versions.

  • Install the Harness CLI (hc). You use it to publish packages to your registry.

  • Make sure you have access to a Harness account with permission to create registries and connectors.

Create a Helm OCI Registry

To create a Helm OCI Registry, perform the following steps:

  1. In Artifact Registry, select Registries.

  2. Select + Create Registry.

  3. Specify the Registry name.

Registry name criteria

The registry name must start with a letter, can only contain lowercase alphanumerics, _, ., and -, and must be unique to your Harness account.

  1. Optionally, add a Description.

  2. Choose visibility between Public and Private. The default is Private.

  3. Select Helm OCI as the Registry type.

  4. Select Save.

  5. Select Create to finalize.

Upstream proxy configuration (optional)

An upstream proxy allows your registry to fetch Helm charts from AWS ECR or another OCI-compliant registry when they are not available locally.

Create upstream proxy

To create an upstream proxy, perform the following steps:

  1. In Artifact Registry, select Registries.

  2. Select the drop-down next to + Create Registry and select Upstream Proxy.

  3. Specify the Registry name.

  4. Optionally, add a Description.

  5. Choose visibility between Public and Private. The default is Private.

  6. Select Helm OCI as the Registry type.

  7. Select the Source: AWS ECR or Custom.

  8. Specify the Remote registry URL for the OCI registry you want to proxy, for example oci://registry-1.docker.io.

  9. Select the Authentication method.

    • Access key and Secret key (for AWS ECR): Specify the Access key as Plain Text or an encrypted value, then specify the Secret key. Use an existing secret, or create a new secret by specifying the Name and entering the Secret text.

    • Username and password (for Custom): Specify the username and password. Use an existing secret, or create a new secret by specifying the Name and entering the Secret text.

    • Anonymous: No credentials required. This works for public OCI registries that allow anonymous pulls.

  10. Click Create to finalize.

Configure the upstream proxy in your registry

To configure the upstream proxy in your registry, perform the following steps:

  1. In Artifact Registry, select an existing Helm OCI artifact.

  2. Navigate to the Configuration tab.

  3. Select Edit in the Upstream proxy section.

  4. Select + Add upstream proxy.

  5. Select the required proxy from the list.

  6. Select Apply.

  7. Select Update to finalize.

Upstream proxy caching

If a chart is not found in your Harness registry, the upstream proxy fetches it from the remote OCI registry and caches it.

Helm OCI client setup

In your Helm OCI Artifact, select the registry, then select Set Up Client. The dialog gives you an identity token and the login, push, and pull commands for your registry.

Generate an identity token

An identity token serves as the password for authenticating with the registry.

  1. In your Helm OCI Artifact, select Set Up Client.

  2. Select Generate Token.

  3. Select an Expiration for the token:

    • 30 Days

    • 90 Days

    • 180 Days

    • Custom

  4. Copy the token. You use it in the following steps in place of <IDENTITY_TOKEN>.

Token expiration

The identity token stops working after the expiration you select. Generate a new token and update your client configuration before the current token expires.

Configure the client

In the code samples, replace the values in angle brackets with your own values.

1. Authenticate the Helm CLI

Log in to the registry:

When prompted, enter <USERNAME> for Username (your Harness account email) and <IDENTITY_TOKEN> for Password.

2. Push a chart

Package your chart, then push it to the registry:

3. Pull a chart

Pull a specific chart version from the registry by digest:

Replace <IMAGE_NAME> with the chart name and <DIGEST> with the chart's SHA256 digest, both shown in Set Up Client and in your registry's package list.

Setup verification

Confirm that your registry serves the chart you published. To verify your setup, perform the following steps:

  1. In a new directory with no cached charts or Helm repository index files, use the Helm CLI to pull the chart you published.

  2. Confirm that the client downloaded the chart from your Harness registry address, which is shown in Set Up Client.

  3. In Harness, open your registry and confirm that the chart and version appear in the package list.

If a step fails, go to Troubleshooting to resolve common authentication and resolution issues before you retry.

Pipeline automation (optional)

Publishing from a pipeline gives you a repeatable release process. Run the publish step when you create a version tag, so each release maps to one chart version in the registry.

The following Run step packages and pushes a chart. Store the identity token as a Harness secret, and do not write it into the pipeline YAML.

Troubleshooting

`helm registry login`, `helm push`, or `helm pull` fails with `401 Unauthorized`

Check that the username and identity token match what you generated in Set Up Client. If the token expired or was revoked, generate a new one and log in again.

`helm push` returns `409 Conflict`

Chart versions are immutable after publish. Bump the version field in Chart.yaml, repackage the chart, and push again.

`helm pull` fails with `not found` or `manifest unknown`

Check that the chart name, digest or tag, registry name, and account ID in the pull command match the values shown in Set Up Client and the package list for the chart you published.

`helm push` or `helm pull` fails with an invalid reference error

Check that the repository URL starts with the oci:// prefix. Helm rejects the command if the prefix is missing.

Set Up Client does not show a push command for an upstream proxy registry

An upstream proxy registry is pull-only. To publish a chart, push it to a virtual Helm OCI registry instead, or configure the upstream proxy so pulled charts are cached automatically.

Next steps

Last updated

Was this helpful?