Aspire.Hosting.Kubernetes
13.6.0-preview.1.26479.8
Prefix Reserved
dotnet add package Aspire.Hosting.Kubernetes --version 13.6.0-preview.1.26479.8
NuGet\Install-Package Aspire.Hosting.Kubernetes -Version 13.6.0-preview.1.26479.8
<PackageReference Include="Aspire.Hosting.Kubernetes" Version="13.6.0-preview.1.26479.8" />
<PackageVersion Include="Aspire.Hosting.Kubernetes" Version="13.6.0-preview.1.26479.8" />
<PackageReference Include="Aspire.Hosting.Kubernetes" />
paket add Aspire.Hosting.Kubernetes --version 13.6.0-preview.1.26479.8
#r "nuget: Aspire.Hosting.Kubernetes, 13.6.0-preview.1.26479.8"
#:package Aspire.Hosting.Kubernetes@13.6.0-preview.1.26479.8
#addin nuget:?package=Aspire.Hosting.Kubernetes&version=13.6.0-preview.1.26479.8&prerelease
#tool nuget:?package=Aspire.Hosting.Kubernetes&version=13.6.0-preview.1.26479.8&prerelease
Kubernetes hosting integration
Use this integration to model, configure, and deploy Aspire compute resources to Kubernetes.
Getting started
Prerequisites
- Helm v4.2.0 or later on your
PATH.
Aspire shells out to helm upgrade --install to deploy the generated chart and validates the Helm version up front, so missing or older installs produce a clear actionable error instead of cryptic flag failures.
Add the integration
From your AppHost directory, add the Aspire.Hosting.Kubernetes integration with the Aspire CLI:
aspire add Aspire.Hosting.Kubernetes
Usage example
In the AppHost, add the environment:
C#
builder.AddKubernetesEnvironment("k8s");
TypeScript
await builder.addKubernetesEnvironment("k8s");
Volumes
Use a target-neutral volume when the Kubernetes environment's default storage policy is sufficient:
C#
builder.AddProject<Projects.Api>("api")
.WithVolume("data", "/data", env: "DATA_PATH");
TypeScript
const api = await builder.addNodeApp("api", "../api", "server.js");
await api.withVolume("/data", "data", "DATA_PATH");
Projects and executables receive a workload-scoped Aspire store directory in run mode. The directory is reused across AppHost runs regardless of whether the process has a session or persistent lifetime. When published, the volume uses the Kubernetes environment's DefaultStorageType, which is emptyDir — storage lives for the lifetime of the pod and is lost when the pod restarts or is rescheduled. DATA_PATH contains /data. For storage that outlives the pod, use a persistent volume instead.
Persistent volumes
Add a persistent volume and expose its effective path through an environment variable:
C#
var k8s = builder.AddKubernetesEnvironment("k8s");
var data = k8s.AddPersistentVolume("data")
.WithCapacity("20Gi");
builder.AddProject<Projects.Api>("api")
.WithPersistentVolume(data, "/data", env: "DATA_PATH");
TypeScript
const k8s = await builder.addKubernetesEnvironment("k8s");
const data = await k8s.addPersistentVolume("data");
await data.withCapacity("20Gi");
const api = await builder.addNodeApp("api", "../api", "server.js");
await api.withKubernetesPersistentVolumeMount(data, "/data", { env: "DATA_PATH" });
When a project or executable runs locally, DATA_PATH points to a persistent directory in the AppHost's Aspire store. That store is normally under the AppHost intermediate-output directory, so cleaning build outputs can remove the local data. Local containers use a worktree-scoped container volume instead, provided the mount names an environment variable. Mounts that do not name one keep the persistent volume's own name for the local container volume, so data written by an earlier version of the AppHost stays attached. A single persistent-volume resource cannot be shared between local containers and local projects or executables because those execution types cannot use one backing store reliably.
When published or deployed, DATA_PATH contains /data. Applications can therefore use the same environment variable in both environments. The isReadOnly mount option is enforced after deployment, but Aspire cannot make a directory read-only for a process running directly on the host.
aspire publish -o k8s-artifacts
Additional documentation
https://aspire.dev/integrations/gallery/ https://aspire.dev/integrations/compute/kubernetes/
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Aspire.Hosting (>= 13.6.0)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.36.1)
- Grpc.AspNetCore (>= 2.83.0)
- Grpc.Net.ClientFactory (>= 2.83.0)
- Grpc.Tools (>= 2.83.0)
- Hex1b (>= 0.168.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.302)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.12)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.31)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.12)
- Microsoft.Extensions.Hosting (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Logging (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Primitives (>= 10.0.12)
- ModelContextProtocol (>= 1.4.1)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.17.0)
- OpenTelemetry.Extensions.Hosting (>= 1.17.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.12)
- System.Text.Json (>= 10.0.12)
- YamlDotNet (>= 18.1.0)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Aspire.Hosting.Kubernetes:
| Package | Downloads |
|---|---|
|
KubeOps.Aspire.Hosting
.NET Aspire hosting integration for KubeOps operators. Adds an AddKubeOps extension to the distributed application builder so a KubeOps operator project can be orchestrated as a resource in a .NET Aspire AppHost, wired up with references, environment variables and telemetry. |
|
|
Aspire.Hosting.Azure.Kubernetes
Azure Kubernetes Service (AKS) resource types for Aspire. |
|
|
Arkanis.Aspire.Hosting.Extensions.Kubernetes
Reusable Aspire hosting extensions for Kubernetes publishing, manifests, ingress, persistent volumes, environment variables, and deployment-target selection. |
|
|
Arkanis.Aspire.Hosting.Extensions.Kubernetes.ExternalSecrets
Reusable Aspire hosting extensions for publishing External Secrets Operator manifests from Kubernetes and Aspire Secret configuration. |
|
|
Arkanis.Aspire.Hosting.Extensions.Kubernetes.CloudNativePostgres
Reusable Aspire hosting extensions for publishing CloudNativePG database resources and credentials ExternalSecrets. |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Aspire.Hosting.Kubernetes:
| Repository | Stars |
|---|---|
|
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 10, Wolverine, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
|
petabridge/DrawTogether.NET
Multi-player MS Paint application. Built with Akka.NET, Blazor, and .NET Aspire.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 13.6.0-preview.1.26479.8 | 1,346 | 9/29/2026 |
| 13.5.4-preview.1.26464.4 | 13,990 | 9/15/2026 |
| 13.5.3-preview.1.26425.3 | 17,782 | 8/25/2026 |
| 13.5.2-preview.1.26421.6 | 2,718 | 8/21/2026 |
| 13.5.1-preview.1.26420.4 | 313 | 8/20/2026 |
| 13.5.0-preview.1.26417.10 | 6,841 | 8/18/2026 |
| 13.4.6-preview.1.26319.6 | 45,083 | 6/19/2026 |
| 13.4.5-preview.1.26316.12 | 3,518 | 6/17/2026 |
| 13.4.4-preview.1.26314.3 | 5,209 | 6/15/2026 |
| 13.4.3-preview.1.26305.13 | 7,758 | 6/8/2026 |
| 13.4.2-preview.1.26303.6 | 2,452 | 6/3/2026 |
| 13.4.1-preview.1.26303.3 | 93 | 6/3/2026 |
| 13.4.0-preview.1.26281.18 | 17,783 | 6/1/2026 |
| 13.3.5-preview.1.26270.6 | 11,192 | 5/21/2026 |
| 13.3.4-preview.1.26268.8 | 2,850 | 5/19/2026 |
| 13.3.3-preview.1.26264.13 | 9,155 | 5/15/2026 |
| 13.3.2-preview.1.26263.11 | 766 | 5/14/2026 |
| 13.3.1-preview.1.26261.7 | 582 | 5/12/2026 |
| 13.3.0-preview.1.26256.5 | 2,739 | 5/7/2026 |
| 13.2.4-preview.1.26224.4 | 7,705 | 4/24/2026 |