> For the complete documentation index, see [llms.txt](https://docs.portainer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.portainer.io/sts/user/edge/stacks/add/helm-chart-deployment.md).

# Helm chart deployment

Define how to deploy your app from one of the **Build Method** options.

| Option                              | Overview                                                                                                                                                          |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Repository](#repository)           | Use a GitHub repo where the build file is stored.                                                                                                                 |
| [Helm Repository](#helm-repository) | Point Portainer at any accessible Helm chart repository, browse the available charts, and deploy directly from it without needing to manage chart files manually. |

<figure><img src="/files/47TdZRMBVKSTDi5dquyA" alt=""><figcaption></figcaption></figure>

### Repository

Enter the information about your Git repository to deploy your Edge Stack from Git.

| Field/Option         | Overview                                                                                                 |
| -------------------- | -------------------------------------------------------------------------------------------------------- |
| Source               | Select your Git repository from your list of preconfigured [sources](/sts/user/app-delivery/sources.md). |
| Repository reference | Select the reference to use when deploying the stack (for example, the branch).                          |
| GitOps updates       | Toggle this on to enable GitOps updates (see below).                                                     |

<figure><img src="/files/dkMS0ZWnDSKeQmVhzMW6" alt=""><figcaption></figcaption></figure>

#### GitOps updates

{% hint style="info" %}
This feature is only available in [Portainer Business Edition](https://www.portainer.io/business-upsell?from=ca-file).
{% endhint %}

Portainer supports automatically updating your Edge Stacks deployed from Git repositories. To enable this, toggle on **GitOps updates** and configure your settings.

{% hint style="info" %}
For more detail on how automatic updates function under the hood, have a look at [this FAQ](/sts/faqs/troubleshooting/stacks-deployments-and-updates/how-do-automatic-updates-for-stacks-applications-work.md).
{% endhint %}

| Field/Option   | Overview                                                                                                                                                                                                                                                                                                                                      |
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Mechanism      | <p>Select the method to use when checking for updates:</p><p><strong>Polling:</strong> Periodically poll the Git repository from Portainer to check for updates to the repository.</p><p><strong>Webhook:</strong> Generate a webhook URL to add to your Git repository to trigger the update on demand (for example via GitHub actions).</p> |
| Fetch interval | If **Polling** is selected, how often Portainer will check the Git repository for updates.                                                                                                                                                                                                                                                    |
| Webhook        | When **Webhook** is selected, displays the webhook URL to use in your integration. Click **Copy link** to copy the webhook URL to the clipboard.                                                                                                                                                                                              |

<figure><img src="/files/xz3jP4OwOGBZNqGS5ar7" alt=""><figcaption><p>GitOps updates when using polling</p></figcaption></figure>

<figure><img src="/files/ranVgH4CJo8mpSpkVPvx" alt=""><figcaption><p>GitOps updates when using webhooks</p></figcaption></figure>

|                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Re-pull image      | When enabled, Portainer checks for an updated image when a redeploy is triggered via webhook or polling. It uses the tag you configured; if no tag is set, or you set `latest`, it uses `latest`. If that tag now points to a new image, Portainer pulls it and redeploys the workload.                                                                                                                                                                                                                                                                     |
| Force redeployment | <p>Enable this setting to force the redeployment of your stack at the specified interval (or when the webhook is triggered), overwriting any changes that have been made in the local environment, even if there has been no update to the stack in Git. This is useful if you want to ensure that your Git repository is the source of truth for your stacks and are happy with the local stack being replaced.</p><p>If this option is left disabled, automatic updates will only trigger if Portainer detects a change in the remote Git repository.</p> |

<figure><img src="/files/ijQfuVll1UMZdpGy6gXq" alt=""><figcaption></figcaption></figure>

#### Deploy to

When deploying using a Helm repository, the **Release name** will be automatically generated based on the stack name given above. Specify a **Namespace**.

#### Helm chart

<figure><img src="/files/SUsFUlStb1D7XmfwmeIc" alt=""><figcaption></figcaption></figure>

Next, specify the path to the Helm chart folder from the root of your repository. The folder must contain a Chart.yaml file.

Toggle on **GitOps Edge Configurations** in able to use dynamic variables in your Helm values file paths. When enabled, Portainer will automatically fetch the content from your git repository by matching the folder name or file name with the Portainer Edge ID or Edge Group name, and apply it to the environment where the stack is deployed. Specify the **configuration path** and a device matching rule or a group matching rule from the drop down selectors.

<figure><img src="/files/PqdIBxVtme4oYLAGLOT9" alt=""><figcaption></figcaption></figure>

#### Install options

Optionally specify any **values files** to override the default chart values. If multiple values files are specified, they will be merged in the order they are added and therefore the last values file takes precedence.

You can get more information about the Helm values file format in the [official Helm documentation](https://helm.sh/docs/chart_template_guide/values_files/).

<figure><img src="/files/tRolmNF7k0FDFzKmeUYP" alt=""><figcaption></figcaption></figure>

### Helm Repository

When deploying using a Helm repository, the **Release name** will be automatically generated based on the stack name given above. Begin your configuration by specifying a **Namespace**.

<figure><img src="/files/SUsFUlStb1D7XmfwmeIc" alt=""><figcaption></figcaption></figure>

Next, select a **Helm chart source** from the dropdown. Portainer will retrieve the available charts from the selected registry and display them in the list below. Use the search bar or filter by category to find the chart you need, then select it.

{% hint style="info" %}
When a Helm chart source is selected for the first time, it may take a moment to download and populate the chart list.
{% endhint %}

Once a chart is selected, Portainer will automatically import the `values.yaml` file for the latest chart version, displaying it in the right-hand pane for reference. Use the left-hand pane to make any necessary customizations. To deploy a different version, select it from the **Version** dropdown.

<figure><img src="/files/xySvrPee7htLeI3Q7Qee" alt=""><figcaption></figcaption></figure>

## Additional settings

### Install options

Optionally specify the following for your deployment:

* **Rollback on failure** - Toggle on to automatically roll back the release if the deployment fails.
* **Timeout** - Set the maximum time allowed for Helm operations to complete. Leave blank for the default timeout to be applied.

### Update configurations

{% hint style="info" %}
This feature is only available in [Portainer Business Edition](https://www.portainer.io/business-upsell?from=ca-file).
{% endhint %}

This section lets you define the method in which your stack updates are deployed across your Edge devices. You can choose to deploy to **All edge devices at once**, or select **Parallel edge device(s)** to specify how many devices to update concurrently.

{% hint style="warning" %}
These settings do **not** apply to the *initial* provision of your Edge Stack. These only apply to the process that will occur when your stack is updated *after* deployment.
{% endhint %}

<figure><img src="/files/H0NsxuFGYfXKMtJj3wmR" alt=""><figcaption></figcaption></figure>

If **Parallel edge device(s)** is selected, you can choose to either deploy in static group sizes or in an exponential rollout strategy. For static group sizes, choose the **Number of device(s)** option and specify your group size.

<figure><img src="/files/9quMWM9QeykOy0C7UWZa" alt=""><figcaption></figcaption></figure>

For an exponential rollout, choose the **Exponential rollout** option and specify how many devices to start with, then select the multiplier to apply to the initial size. For example, selecting a start size of 5 and a multiplier of 2, stack updates would be rolled out to 5 devices, then 10 (5 x 2), then 20 (10 x 2), and so forth.

<figure><img src="/files/dGWtWoAmT5ODQ6pCGmNR" alt=""><figcaption></figcaption></figure>

When using parallel rollouts, you can also specify the **Timeout** (in minutes) before Portainer considers the update to have failed, as well as the **Update delay** (in minutes) between each group of updates are applied.

In addition, you can define the **Update failure action** that will be taken if the update fails:

* **Continue** will move on to the next group of devices to update.
* **Pause** will halt the update process but will keep the update applied to any devices that have already been deployed to.
* **Rollback** will halt the update process and roll back the update on devices already updated.

<figure><img src="/files/WQnglNEDXeyhennB1wCa" alt=""><figcaption></figcaption></figure>

Once the configuration is completed, click **Deploy the stack**.
