Use a Helm Repository with Kubernetes

Updated 2 months ago by Michael Cretzman

You can link remote Helm charts in a Helm Repository to your Harness Kubernetes Service, such as AWS S3, Google Cloud Storage (GCS), or a chart repo such as Bitnami.

You can also use Helm charts in a Git repo. For more information, see Link Resource Files or Helm Charts in Git Repos.

In this topic:

Before You Begin

Migrating from a Harness Helm Deployment Type?

If you are migrating from a Harness Helm deployment type to the Kubernetes deployment type, be aware that Helm charts in Kubernetes V2 require that you set up a Harness Helm Artifact Server to connect to your remote Helm chart repo.

Step 1: Helm Repository Artifact Server

Before you can link a Helm Repository to your Harness Kubernetes Service, you create a Harness Artifact Server to connect Harness with a Helm Repository.

See Add Helm Repository Artifact Servers.

  1. In your Harness Kubernetes Service, in Manifests, click Link Remote Manifests. The Remote Manifests settings appear.
  2. In Manifest Format, select Helm Chart from Helm Repository.
  3. In Helm Repository, select the Helm Chart Repository you added as a Harness Artifact Server. For more information, see Add Helm Repository Artifact Servers.
    If you are using GCS or a storage service for your Helm Repository, you will see a Base Path setting.
  4. In Base Path (GCS or a storage service only), enter the path to the charts' bucket folder or a Workflow variable expression.
    1. If you use a charts' bucket folder, simply enter the name of the folder. Whether you need to specify a single folder (e.g. charts) a folder path (e.g. helm/charts) depends on the Helm Chart Repository you added as a Harness Artifact Server.
    2. If you use a Workflow variable expression, you can enter in the expression as part of the path. For example, /Myservice/Chart/${workflow.variables.branchName}/ or simply ${workflow.variables.chartFolder}.
    1. If the chart is in the root folder of the repository location set in the Helm Chart Repository you added as a Harness Artifact Server, leave Base Path empty.
  5. In Chart Name, enter the name of the chart in that repo. For example, we use nginx.
  6. In Chart Version, enter the chart version to use. This is found in the Chart.yaml version label. For this guide, we will use 1.0.1. If you leave this field empty Harness gets the latest chart.
  7. In Helm Version, select the Helm version of your chart, such as v3.

When you are finished, the dialog will look like this:

Example 1: Google GCS and AWS S3

Example 2: Workflow Variable Expression

Here is an example using a Workflow variable expression. You can see the variable created in the Workflow's Workflow Variables section, referenced using an expression in Remote Manifests, and then a value provided for the variable in the deployment dialog that matches the chart folder's name.

Click Submit. The Helm repo is added to Manifests.

Example 3: Deploying Kubernetes Service Linked to a Helm Repository

When you deploy a Workflow using a Harness Kubernetes Service set up with a Helm Repository, you will see Harness fetch the chart:

Next, you will see Harness initialize using the chart:

Harness does not support the following objects when using Helm charts in Harness Kubernetes deployments: ClusterRoleBindingList, RoleBindingList, RoleList.
If you use these objects in your chart, Harness will consider the chart invalid and fail the deployment.
See the Kubernetes API docs for information on these deployments.

The Helm version info is displayed in the Service dashboard:

Next Steps

You can override the Helm Repository in a Harness Environment Service Configuration Overrides section. See Override Harness Kubernetes Service Settings.

How did we do?