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:
In Artifact Registry, select Registries.
Select + Create Registry.
Specify the Registry name.
Optionally, add a Description.
Choose visibility between Public and Private. The default is Private.
Select Helm OCI as the Registry type.
Select Save.
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:
In Artifact Registry, select Registries.
Select the drop-down next to + Create Registry and select Upstream Proxy.
Specify the Registry name.
Optionally, add a Description.
Choose visibility between Public and Private. The default is Private.
Select Helm OCI as the Registry type.
Select the Source: AWS ECR or Custom.
Specify the Remote registry URL for the OCI registry you want to proxy, for example
oci://registry-1.docker.io.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.
Click Create to finalize.
Configure the upstream proxy in your registry
To configure the upstream proxy in your registry, perform the following steps:
In Artifact Registry, select an existing Helm OCI artifact.
Navigate to the Configuration tab.
Select Edit in the Upstream proxy section.
Select + Add upstream proxy.
Select the required proxy from the list.
Select Apply.
Select Update to finalize.
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.
In your Helm OCI Artifact, select Set Up Client.
Select Generate Token.
Select an Expiration for the token:
30 Days
90 Days
180 Days
Custom
Copy the token. You use it in the following steps in place of
<IDENTITY_TOKEN>.
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:
In a new directory with no cached charts or Helm repository index files, use the Helm CLI to pull the chart you published.
Confirm that the client downloaded the chart from your Harness registry address, which is shown in Set Up Client.
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
Next steps
To add a pipeline that publishes a new version for every release tag, go to Harness CI.
To control who can publish and consume packages in your registry, go to RBAC and permissions.
To set retention and lifecycle rules for old versions, go to Lifecycle Management overview.
Last updated
Was this helpful?