Sub topic 6
Pushing a chart
This chapter assumes you know how to install a chart and read Chart.yaml. It also assumes Helm 3.8 or later, a registry account you can write to, and that you have already packaged a chart and logged in. Here you will push the packaged chart and check the result.
What helm push does
helm push uploads a packaged chart (a .tgz archive) to an OCI registry. It takes two arguments: the archive and a destination that starts with oci://.
helm push myapp-0.1.0.tgz oci://registry.example.com/chartsHelm builds the final location itself. It reads name and version from the archive's Chart.yaml, then appends the name to the destination path and uses the version as the tag. The destination you type must not include the chart name or the tag.
apiVersion: v2
name: myapp
description: Example application chart
type: application
version: 0.1.0
appVersion: "1.0.0"With this Chart.yaml, the push above lands at registry.example.com/charts/myapp:0.1.0.
| You type | Helm stores |
|---|---|
| `oci://registry.example.com/charts` | `registry.example.com/charts/myapp:0.1.0` |
| `oci://registry.example.com/team/charts` | `registry.example.com/team/charts/myapp:0.1.0` |
The full sequence
helm package ./myapp
# Successfully packaged chart and saved it to: /path/to/myapp-0.1.0.tgz
helm registry login registry.example.com --username alice
helm push myapp-0.1.0.tgz oci://registry.example.com/charts
# Pushed: registry.example.com/charts/myapp:0.1.0
# Digest: sha256:...The output has two lines worth noting. Pushed: shows the full reference Helm wrote. Digest: shows the content hash of the uploaded chart. Keep the digest if you plan to pin the chart later, because a digest identifies exact content while a tag can be moved.
Common mistakes
Most push failures come from the destination or from credentials.
- Including the chart name in the destination.
oci://registry.example.com/charts/myappmakes Helm store the chart atcharts/myapp/myapp. Give only the parent path. - Passing a directory instead of an archive.
helm pushneeds the.tgzfile. Runhelm packagefirst. - Expecting to choose the tag. The tag always equals the chart
version. To publish a different tag, changeversioninChart.yamland package again. - Not being logged in. The registry rejects the upload with an authentication error. Run
helm registry loginagainst the registry host, not the full path. - Uppercase letters in the path. Registries require lowercase repository names. A path such as
my-Org/chartsfails on many of them.
Verifying the push
Confirm the chart is readable by fetching its metadata with the version flag:
helm show chart oci://registry.example.com/charts/myapp --version 0.1.0Note the difference from pushing. When you read a chart, the reference includes the chart name, and the version goes in --version. If this command prints your Chart.yaml fields, the push worked. Later chapters cover pulling and installing in detail.
Helm has no command that lists the tags in a repository. Use the registry's web interface or a tool such as crane ls or oras repo tags to see what versions exist.
Exercise
Your chart's Chart.yaml has name: webapp and version: 2.3.1. You run helm push webapp-2.3.1.tgz oci://registry.example.com/platform/charts. What full reference does Helm store, and what happens if you instead pass oci://registry.example.com/platform/charts/webapp?
Show answer
Helm stores registry.example.com/platform/charts/webapp:2.3.1. With the chart name added to the destination, Helm appends the name again and stores the chart at registry.example.com/platform/charts/webapp/webapp:2.3.1, which is not the path you intended and will not match a dependency or install reference that expects platform/charts/webapp.
Exercise
A teammate wants to publish the tag "latest" by running helm push with a custom tag argument. Why does this not work, and what do you change to publish a new tag?
Show answer
helm push has no tag option. The tag is taken from the version field in Chart.yaml. To publish a new tag, change version in Chart.yaml, run helm package again, and push the new archive.