Skip to content
Docs Try Aspire
Docs Try

Install external Helm charts

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.

For the core Kubernetes deployment setup, see Deploy to Kubernetes clusters or Deploy to AKS.

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}).

Add the chart to 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:

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();

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

Pass the chart version string expected by the chart repository, such as 1.17.0 or v1.18.2.

Set Helm values to pass --set key=value arguments to the Helm install command:

AppHost.cs
k8s.AddHelmChart("cert-manager", "oci://quay.io/jetstack/charts/cert-manager", "1.17.0")
.WithHelmValue("crds.enabled", "true")
.WithHelmValue("config.enableGatewayAPI", "true");

Value keys support dot-notation (config.enableGatewayAPI) and indexed array paths (args[0]). Values are passed to Helm with --set flags.

By default, the chart is installed in a namespace named after the chart resource and uses the chart resource name as the Helm release name. Override these in your AppHost when you need a different namespace or release name:

AppHost.cs
k8s.AddHelmChart("ingress-nginx", "oci://ghcr.io/nginx/helm/nginx-ingress", "2.0.0")
.WithNamespace("ingress-nginx")
.WithReleaseName("ingress-nginx");
  • Namespace overrides must follow RFC 1123 DNS label rules (lowercase alphanumerics and hyphens, max 63 characters).
  • Release name overrides must follow Helm’s release-name rules (DNS label format, max 53 characters).

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, enable destroy-time uninstall in your AppHost:

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

When destroy-time uninstall is enabled, aspire destroy runs helm uninstall for the chart in addition to removing your application’s resources.

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

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();

The AKS environment delegates external chart installation to its inner Kubernetes environment, so the same Helm value, namespace, release name, and destroy-time uninstall options apply.

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

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();