> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/build-and-upload-artifacts/upload-artifacts/upload-helm-chart.md).

# Upload Helm charts to container registries

Use a plugin to publish Helm charts to Docker registries

## What you will learn from this topic

* How to configure the Helm Push plugin for Google Artifact Registry
* How to configure the Helm Push plugin for Docker Hub
* How to view build logs and find Helm chart artifacts

## Before you begin

* **CI pipeline**: You need an existing CI pipeline to add the Helm Push plugin step to.
* **Container registry connector**: You need a Harness connector for Docker Hub or Google Artifact Registry.

The [Helm Push plugin](https://github.com/harness-community/drone-push-helm-chart-docker-registry) streamlines the packaging and distribution of [Helm charts](https://helm.sh/docs/topics/charts/) to container registries.

Go to the Harness blog post [Push Helm Charts to Container Registries with Harness CI](https://www.harness.io/blog/helm-container-registries-harness-ci) for why we created this plugin. Go to the Helm documentation on [Using an OCI-based registry](https://helm.sh/docs/topics/registries/#using-an-oci-based-registry) for the Helm commands used by this plugin.

Go to [Explore plugins](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/explore-ci-plugins.md) and [Use Drone plugins](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/run-a-drone-plugin-in-ci.md) for general information about using plugins in CI pipelines.

### Supported registries <a href="#supported-registries" id="supported-registries"></a>

Currently, this plugin supports pushing Helm charts to Docker Hub and Google Artifact Registry.

If you need to upload Helm charts to another to a Docker-compliant OCI registry that is not supported by this plugin, you can run the necessary `helm` commands in a [Run step](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/run-step-settings.md) or use the [Helm Push plugin](https://github.com/harness-community/drone-push-helm-chart-docker-registry) as a basis to [write your own plugin](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/custom_plugins.md). Go to the Helm documentation on [Using an OCI-based registry](https://helm.sh/docs/topics/registries/#using-an-oci-based-registry) for the `helm` commands.

### Configure the Helm push plugin <a href="#configure-the-helm-push-plugin" id="configure-the-helm-push-plugin"></a>

{% tabs %}
{% tab title="Upload Helm charts to GAR" %}
To use the Helm Push plugin to upload Helm charts to GAR, [add a Plugin step](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/run-a-drone-plugin-in-ci.md) to your [CI pipeline](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/prep-ci-pipeline-components.md). For example:

```yaml
              - step:
                  type: Plugin
                  name: upload_helm_chart
                  identifier: upload_helm_chart
                  spec:
                    connectorRef: YOUR_IMAGE_REGISTRY_CONNECTOR
                    image: plugins/helm-push:ARCH_TAG
                    settings:
                      registry_url: LOCATION-docker.pkg.dev
                      registry_username: oauth2accesstoken
                      registry_password: <+secrets.getValue("access_token")>
                      chart_path: path/to/chart
                      gcloud_project_id: PROJECT_ID
                      registry_namespace: REPO_ID
```

To use the Helm Push plugin, configure the [Plugin step settings](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/plugin-step-settings-reference.md) as follows:

| Keys                 | Type   | Description                                                                                                                                                                                                                                                                                     | Value example                                           |
| -------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| `connectorRef`       | String | Select a [Docker connector](broken://spaces/3F2TpHXhur2QtQnORSM9/pages/LZPXMHJjbQyZXdwC5Omo).                                                                                                                                                                                                   | `YOUR_IMAGE_REGISTRY_CONNECTOR`                         |
| `image`              | String | Enter `plugins/helm-push:ARCH_TAG` and replace `ARCH_TAG` with the relevant architecture tag to use. Go to the [Helm Push plugin README](https://github.com/harness-community/drone-helm-chart-container-registry?tab=readme-ov-file#plugin-image) for a list of available tags.                | `plugins/helm-push:linux-amd64`                         |
| `registry_url`       | String | Base URL for the Docker registry where the packaged chart will be published. For GAR, this must be `LOCATION-docker.pkg.dev`. Replace `LOCATION` with your GAR repository's regional or multi-regional [location](https://cloud.google.com/artifact-registry/docs/repositories/repo-locations). | `us-east4-docker.pkg.dev`                               |
| `registry_username`  | String | For GAR, this must be `oauth2accesstoken`                                                                                                                                                                                                                                                       | `oauth2accesstoken`                                     |
| `registry_password`  | String | Reference to a [Harness text secret](https://developer.harness.io/harness-platform/use-harness-platform/secrets/add-use-text-secrets.md) containing your [GAR Helm access token](https://cloud.google.com/artifact-registry/docs/helm/authentication#token).                                    | `<+secrets.getValue("docker_chart_registry_password")>` |
| `chart_path`         | String | Path to the directory containing the Helm chart to upload, relative to the pipeline workspace. The default is `/harness` (the pipeline workspace root directory).                                                                                                                               | `charts` (navigates to `/harness/charts`)               |
| `gcloud_project_id`  | String | Your [Google Cloud project ID](https://cloud.google.com/artifact-registry/docs/helm/manage-charts#push)                                                                                                                                                                                         | `my-project`                                            |
| `registry_namespace` | String | Your [GAR repository name](https://cloud.google.com/artifact-registry/docs/helm/manage-charts#push) where you want to publish the chart.                                                                                                                                                        | `my-repo`                                               |
| {% endtab %}         |        |                                                                                                                                                                                                                                                                                                 |                                                         |

{% tab title="Upload Helm charts to Docker Hub" %}
To use the Helm Push plugin to upload Helm charts to Docker Hub, [add a Plugin step](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/run-a-drone-plugin-in-ci.md) to your [CI pipeline](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/prep-ci-pipeline-components.md). For example:

```yaml
              - step:
                  type: Plugin
                  name: upload_helm_chart
                  identifier: upload_helm_chart
                  spec:
                    connectorRef: YOUR_IMAGE_REGISTRY_CONNECTOR
                    image: plugins/helm-push:ARCH_TAG
                    settings:
                      registry_url: registry.hub.docker.com
                      registry_username: DOCKER_USERNAME
                      registry_password: <secrets.getValue("docker_pat")>
                      chart_path: path/to/chart
                      registry_namespace: DOCKER_NAMESPACE
```

To use the Helm Push plugin, configure the [Plugin step settings](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/plugin-step-settings-reference.md) as follows:

| Keys                 | Type   | Description                                                                                                                                                                                                                                                                           | Value example                             |
| -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `connectorRef`       | String | Select a [Docker connector](broken://spaces/3F2TpHXhur2QtQnORSM9/pages/LZPXMHJjbQyZXdwC5Omo).                                                                                                                                                                                         | `YOUR_IMAGE_REGISTRY_CONNECTOR`           |
| `image`              | String | Enter `plugins/helm-push:ARCH_TAG` and replace `ARCH_TAG` with the relevant architecture tag to use. Go to the [Helm Push plugin README](https://github.com/harness-community/drone-helm-chart-container-registry?tab=readme-ov-file#plugin-image) for a list of available tags.      | `plugins/helm-push:linux-amd64`           |
| `registry_url`       | String | Base URL for the Docker registry where the packaged chart will be published. For Docker Hub, this must be `registry.hub.docker.com`                                                                                                                                                   | `registry.hub.docker.com`                 |
| `registry_username`  | String | Username to access your Docker Hub registry                                                                                                                                                                                                                                           | `hubuser`                                 |
| `registry_password`  | String | Reference to a [Harness text secret](https://developer.harness.io/harness-platform/use-harness-platform/secrets/add-use-text-secrets.md) containing a Docker Hub personal access token.                                                                                               | `<+secrets.getValue("docker_pat")>`       |
| `chart_path`         | String | Path to the directory containing the Helm chart to upload, relative to the pipeline workspace. The default is `/harness` (the pipeline workspace root directory).                                                                                                                     | `charts` (navigates to `/harness/charts`) |
| `registry_namespace` | String | The Docker namespace where you want to publish the Helm chart, such as your personal namespace or an org namespace. Go to the Docker documentation on [Pushing a Helm chart to Docker Hub](https://docs.docker.com/docker-hub/oci-artifacts/#push-a-helm-chart) for more information. | `myorg`                                   |
| {% endtab %}         |        |                                                                                                                                                                                                                                                                                       |                                           |
| {% endtabs %}        |        |                                                                                                                                                                                                                                                                                       |                                           |

{% hint style="info" %}
You can use variable expressions for plugin settings. For example, `registry_username: <+stage.variables.docker_user_name>` references a [stage variable](https://developer.harness.io/harness-platform/use-harness-platform/pipelines/add-a-stage.md#stage-variables) called `DOCKER_USER_NAME`.
{% endhint %}

### Build logs and artifact files <a href="#build-logs-and-artifact-files" id="build-logs-and-artifact-files"></a>

When you run the pipeline, you can observe the step logs on the [build details page](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/viewing-builds.md) and then find the Helm chart in your container registry.

Optionally, you can use the [Artifact Metadata Publisher plugin](https://github.com/drone-plugins/artifact-metadata-publisher) to publish artifact URLs on the [Artifacts tab](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/viewing-builds.md). This makes it easier to find artifacts associated with specific builds.

## Troubleshooting

<details>

<summary>A step fails unexpectedly</summary>

Contact [Harness Support](mailto:support@harness.io).

</details>

## Next steps

* Go to [Explore plugins](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/explore-ci-plugins.md) to discover other available CI plugins.
* Go to [Build details](https://developer.harness.io/continuous-integration/use-harness-ci/use-harness-ci/viewing-builds.md) to monitor pipeline execution.

{% @harness-feedback/feedback %}
