KubernetesHelmChartResource
Class sealed net8.0
Represents an external Helm chart to be installed into a Kubernetes environment. This resource models a Helm chart from a repository (OCI or HTTP) that will be installed as a pipeline step after the main application Helm chart is deployed.
namespace Aspire.Hosting.Kubernetes;
public sealed class KubernetesHelmChartResource : Aspire.Hosting.ApplicationModel.Resource, Aspire.Hosting.ApplicationModel.IResource, Aspire.Hosting.ApplicationModel.IResourceWithParent, Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.Kubernetes.KubernetesEnvironmentResource>{ // ...} ResourceIResourceIResourceWithParentIResourceWithParent<KubernetesEnvironmentResource>
6 members
Remarks
Section titled Remarks Create a Helm chart resource using KubernetesHelmChartExtensions.AddHelmChart and configure it with values using KubernetesHelmChartExtensions.WithHelmValue.
At deploy time, the chart is installed via helm upgrade --install as a pipeline step that runs after the main application Helm chart is deployed. The chart is installed into the specified namespace (defaulting to the chart name).
By default, an external Helm chart is not uninstalled by aspire destroy. Opt in to destroy-time uninstall by calling KubernetesHelmChartExtensions.WithDestroy.
Constructors1
Section titled ConstructorsKubernetesHelmChartResource(string, KubernetesEnvironmentResource, string, string) Initializes a new instance of
KubernetesHelmChartResource. Properties5
Section titled PropertiesChartReferencegetstring Gets the Helm chart reference. This can be an OCI registry URL (e.g.,
oci://quay.io/jetstack/charts/cert-manager) or a chart name from an added repository. ChartVersiongetstring Gets the chart version to install.
Namespaceget; setstring? Gets or sets the Kubernetes namespace to install the chart into. Defaults to the chart resource name if not specified.
Parentget Gets the parent Kubernetes environment resource.
ReleaseNameget; setstring? Gets or sets the Helm release name. Defaults to the resource name.
Examples
Section titled Examplesvar k8s = builder.AddKubernetesEnvironment("k8s");
// Install NGINX Ingress Controller from OCI registryk8s.AddHelmChart("nginx", "oci://ghcr.io/nginx/charts/nginx-ingress", "1.5.0");
// Install cert-manager with custom valuesk8s.AddHelmChart("cert-manager", "oci://quay.io/jetstack/charts/cert-manager", "1.17.0") .WithHelmValue("crds.enabled", "true") .WithHelmValue("config.enableGatewayAPI", "true");