Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/frontend/config/sidebar/deployment.topics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ export const deploymentTopics: StarlightSidebarTopicsUserConfig = {
label: 'Azure Kubernetes Service (AKS)',
slug: 'deployment/kubernetes/aks',
},
{
label: 'External Helm charts',
slug: 'deployment/kubernetes/helm-charts',
},
{
label: 'Ingress & Gateway API',
slug: 'deployment/kubernetes-ingress',
Expand Down
9 changes: 9 additions & 0 deletions src/frontend/src/content/docs/deployment/kubernetes/aks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,19 @@ If pods fail with `ImagePullBackOff`, verify that the AKS cluster has the correc
az aks check-acr --resource-group <resource-group> --name <cluster-name> --acr <acr-name>.azurecr.io
```

## Install external Helm charts

Use `AddHelmChart` on the AKS environment to install pre-existing Helm charts — such as cert-manager or NGINX ingress — as post-deploy pipeline steps alongside your application.

<LearnMore>
See [Install external Helm charts](/deployment/kubernetes/helm-charts/) for a full walkthrough of `AddHelmChart`, `WithHelmValue`, `WithNamespace`, `WithReleaseName`, and `WithDestroy`.
</LearnMore>

## See also

- [AKS integration](/integrations/cloud/azure/aks/)
- [Kubernetes integration](/integrations/compute/kubernetes/)
- [Install external Helm charts](/deployment/kubernetes/helm-charts/)
- [Deploy to Kubernetes](/deployment/kubernetes/)
- [Deploy to Azure](/deployment/azure/)
- [Pipelines and app topology](/deployment/pipelines/)
Expand Down
165 changes: 165 additions & 0 deletions src/frontend/src/content/docs/deployment/kubernetes/helm-charts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
---
title: Install external Helm charts
description: Learn how to install external Helm charts alongside your Aspire application during Kubernetes deployment using AddHelmChart.
---

import { Aside, Steps, Tabs, TabItem } from '@astrojs/starlight/components';
import LearnMore from '@components/LearnMore.astro';

Install pre-existing Helm charts — such as cert-manager, NGINX ingress controller, or monitoring tools — as part of your Aspire Kubernetes deployment. Aspire runs `helm upgrade --install` for each configured external chart after deploying your application's own generated Helm chart.

<LearnMore>
For the core Kubernetes deployment setup, see [Deploy to Kubernetes clusters](/deployment/kubernetes/kubernetes/) or [Deploy to AKS](/deployment/kubernetes/aks/).
</LearnMore>

## Overview

When you use `aspire deploy`, Aspire deploys your application as a Helm chart and then runs any additional install steps you have defined. `AddHelmChart` registers one of these post-deploy pipeline steps. The install order is:

1. Aspire generates and deploys your application's own Helm chart (`helm-deploy-{environment}`).
2. Each external chart registered with `AddHelmChart` is installed via `helm upgrade --install` (`helm-install-{name}`).
Comment on lines +19 to +20
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrap in Steps componenet.


## Add an external Helm chart

Call `AddHelmChart` on a Kubernetes or AKS environment resource, passing the chart name (used as both the resource name and the default Helm release name), a chart reference, and a chart version:

<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

var k8s = builder.AddKubernetesEnvironment("k8s");

k8s.AddHelmChart("cert-manager", "oci://quay.io/jetstack/charts/cert-manager", "1.17.0");

var api = builder.AddProject<Projects.MyApi>("api");

builder.Build().Run();
```
</TabItem>
</Tabs>

The `chartReference` parameter accepts:

- OCI URLs — `oci://registry.example.com/repo/chart`
- HTTP(S) URLs — `https://charts.example.com/chart-1.0.0.tgz`
- Local paths — `./charts/my-chart`
- Packaged `.tgz` filenames — `my-chart-1.0.0.tgz`
- Repository-qualified names — `stable/nginx-ingress`

The `chartVersion` must be a valid semantic version (for example, `1.17.0`).

## Configure Helm values

Use `WithHelmValue` to pass `--set key=value` arguments to the Helm install command:

<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="AppHost.cs"
k8s.AddHelmChart("cert-manager", "oci://quay.io/jetstack/charts/cert-manager", "1.17.0")
.WithHelmValue("crds.enabled", "true")
.WithHelmValue("config.enableGatewayAPI", "true");
```
</TabItem>
</Tabs>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing the TS apphost.ts here, even if we don't have code for it - we should at least have something in a corresponding message that calls out missing support in TS.


Value keys support dot-notation (`config.enableGatewayAPI`) and indexed array paths (`args[0]`). Both key and value are validated to prevent shell metacharacters from being passed to Helm.

## Configure the namespace and release name

By default, the chart is installed using the environment's namespace and the chart's resource name as the release name. Use `WithNamespace` and `WithReleaseName` to override these:

<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="AppHost.cs"
k8s.AddHelmChart("ingress-nginx", "oci://ghcr.io/nginx/helm/nginx-ingress", "2.0.0")
.WithNamespace("ingress-nginx")
.WithReleaseName("ingress-nginx");
```
</TabItem>
</Tabs>

- `WithNamespace` accepts a string that follows [RFC 1123 DNS label](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names) rules (lowercase alphanumerics and hyphens, max 63 characters).
- `WithReleaseName` follows Helm's release-name rules (DNS label format, max 53 characters).

## Uninstall on destroy

By default, external charts are not uninstalled when you run `aspire destroy`. This is intentional: cluster-wide tools such as cert-manager or monitoring agents are often shared by multiple workloads and shouldn't be torn down when a single application is removed.

To opt in to uninstall-on-destroy, call `WithDestroy()`:

<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="AppHost.cs"
k8s.AddHelmChart("podinfo", "oci://ghcr.io/stefanprodan/charts/podinfo", "6.7.1")
.WithHelmValue("replicaCount", "2")
.WithDestroy();
```
</TabItem>
</Tabs>

When `WithDestroy()` is set, `aspire destroy` runs `helm uninstall` for the chart in addition to removing your application's resources.

:::tip
Use `WithDestroy()` for charts that are tightly coupled to the specific application — for example, a sidecar chart that has no value without the app — and omit it for shared infrastructure (cert-manager, observability stacks, etc.).
:::

## Deploy to AKS

The same `AddHelmChart` API is available on AKS environments through the `Aspire.Hosting.Azure.Kubernetes` package:

<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

var aks = builder.AddAzureKubernetesEnvironment("aks");

aks.AddHelmChart("podinfo", "oci://ghcr.io/stefanprodan/charts/podinfo", "6.7.1")
.WithHelmValue("replicaCount", "2")
.WithDestroy();

var api = builder.AddProject<Projects.MyApi>("api");

builder.Build().Run();
```
</TabItem>
</Tabs>

The AKS overload delegates to the inner Kubernetes environment, so all the same `WithHelmValue`, `WithNamespace`, `WithReleaseName`, and `WithDestroy` options apply.

## Complete example

The following example installs cert-manager and a custom podinfo chart alongside an Aspire application on Kubernetes:

<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

var k8s = builder.AddKubernetesEnvironment("k8s");

// cert-manager is a cluster-wide tool — don't uninstall it when the app is destroyed
k8s.AddHelmChart("cert-manager", "oci://quay.io/jetstack/charts/cert-manager", "1.17.0")
.WithHelmValue("crds.enabled", "true");

// podinfo is specific to this app — uninstall it on destroy
k8s.AddHelmChart("podinfo", "oci://ghcr.io/stefanprodan/charts/podinfo", "6.7.1")
.WithNamespace("podinfo")
.WithHelmValue("replicaCount", "2")
.WithDestroy();

var api = builder.AddProject<Projects.MyApi>("api");

builder.Build().Run();
```
</TabItem>
</Tabs>

## See also

- [Deploy to Kubernetes clusters](/deployment/kubernetes/kubernetes/)
- [Deploy to AKS](/deployment/kubernetes/aks/)
- [Kubernetes integration](/integrations/compute/kubernetes/)
- [AKS integration](/integrations/cloud/azure/aks/)
- [Pipelines and app topology](/deployment/pipelines/)
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,9 @@ For more on the pipeline model and how publish and deploy relate, see [Pipelines
description="Hosting integration reference for Aspire.Hosting.Azure.Kubernetes."
href="/integrations/cloud/azure/aks/"
/>
<LinkCard
title="External Helm charts"
description="Install pre-existing Helm charts alongside your application using AddHelmChart."
href="/deployment/kubernetes/helm-charts/"
/>
</CardGrid>
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,19 @@ If your application can't find connection strings at runtime, verify that the ge

Kubernetes Secrets store values as base64-encoded strings. Verify that your Secrets are properly encoded and that the generated templates reference them correctly. Use `kubectl get secret <name> -o yaml` to inspect Secret contents.

## Install external Helm charts

Use `AddHelmChart` on the Kubernetes environment to install pre-existing Helm charts — such as cert-manager, NGINX ingress, or monitoring tools — as post-deploy pipeline steps alongside your application's own chart.

<LearnMore>
See [Install external Helm charts](/deployment/kubernetes/helm-charts/) for a full walkthrough of `AddHelmChart`, `WithHelmValue`, `WithNamespace`, `WithReleaseName`, and `WithDestroy`.
</LearnMore>

## See also

- [Kubernetes integration](/integrations/compute/kubernetes/)
- [Deploy to AKS](/deployment/kubernetes/aks/)
- [Install external Helm charts](/deployment/kubernetes/helm-charts/)
- [Pipelines and app topology](/deployment/pipelines/)
- [Publishing and deployment overview](/deployment/overview/)
- [Kubernetes documentation](https://kubernetes.io/docs/)
Expand Down
Loading