Skip to content
Draft
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
64 changes: 55 additions & 9 deletions src/frontend/src/content/docs/deployment/kubernetes.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
---
title: Deploy to Kubernetes
description: Learn how to publish and deploy your Aspire application to Kubernetes using Helm charts.
description: Learn how to publish and deploy your Aspire application to Kubernetes using Helm charts, including end-to-end deployment with aspire deploy.
sidebar:
badge: Preview
---

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

Kubernetes is a supported deployment target for Aspire applications. By adding the Kubernetes hosting integration to your AppHost, you can use `aspire publish` to generate a complete set of Helm chart artifacts ready for deployment to any Kubernetes cluster.
Kubernetes is a supported deployment target for Aspire applications. By adding the Kubernetes hosting integration to your AppHost, you can:

<Aside type="note">
Kubernetes uses `aspire publish` to generate Helm charts. It does not support
`aspire deploy` — you deploy the generated artifacts using `helm`, `kubectl`,
or your existing GitOps workflow.
</Aside>
- Use `aspire publish` to generate a complete set of Helm chart artifacts ready for deployment to any Kubernetes cluster.
- Use `aspire deploy` for end-to-end automated deployment directly to a Kubernetes cluster via the built-in Helm engine.

<LearnMore>
For hosting integration setup and configuration, see [Kubernetes
Expand Down Expand Up @@ -80,9 +77,57 @@ The publisher generates the following Kubernetes resources from your application
- **Secrets** for sensitive data such as passwords and connection strings
- **Dockerfiles** copied into the output directory for container build contexts

## Deploy with Helm
## Deploy with aspire deploy

`aspire deploy` provides an end-to-end deployment experience that builds your container images, pushes them to a registry, and deploys your application to a Kubernetes cluster — all in a single command. The built-in Helm engine orchestrates these steps automatically.

```bash title="Deploy to Kubernetes"
aspire deploy
```

### How it works

The Helm deployment engine executes the following pipeline for each resource in your application:

1. **Build** — Builds container images for your projects
2. **Push** — Pushes images to the configured container registry
3. **Prepare** — Resolves Helm chart values and updates `Chart.yaml` with the chart version
4. **Helm deploy** — Runs `helm upgrade --install` to perform an idempotent install or upgrade
5. **Print summary** — Retrieves and displays service endpoints via `kubectl`

A teardown step (`helm uninstall`) is also wired up for clean removal when needed.

### Configure Helm deployment options

You can configure the Helm release name, target namespace, and chart version using `WithHelm`:

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

builder.AddKubernetesEnvironment("k8s")
.WithHelm(helm =>
{
helm.WithNamespace("production");
helm.WithReleaseName("my-app");
helm.WithChartVersion("1.0.0");
});
```
</TabItem>
</Tabs>

All `WithHelm` options accept either literal strings or [external parameters](/fundamentals/external-parameters/) for environment-specific configuration.

<Aside type="note">
`aspire deploy` requires `helm` and `kubectl` to be installed and configured
to target your cluster. Ensure your `kubectl` context points to the desired
cluster before running the command.
</Aside>

## Deploy with Helm manually

After generating artifacts, use Helm to deploy your application to a Kubernetes cluster:
If you prefer to manage the Helm lifecycle yourself, generate the Helm chart artifacts first with `aspire publish` and then use the `helm` CLI:

<Steps>

Expand Down Expand Up @@ -239,5 +284,6 @@ In Kubernetes, services discover each other using the cluster's built-in DNS. A
- [Kubernetes integration](/integrations/compute/kubernetes/)
- [Pipelines and app topology](/deployment/pipelines/)
- [Publishing and deployment overview](/deployment/overview/)
- [External parameters](/fundamentals/external-parameters/)
- [Kubernetes documentation](https://kubernetes.io/docs/)
- [Helm documentation](https://helm.sh/docs/)