Get started with the Kind integration
Kind, short for Kubernetes in Docker, runs Kubernetes clusters in containers. The Aspire Community Toolkit Kind integration lets your AppHost create a local Kind cluster, deploy Helm charts or Kubernetes manifests, and pass cluster credentials to other resources.
Use the integration to test Kubernetes operators and workloads during local development. It also provides a Kind-backed compute environment for Aspire’s publish and deploy commands.
Why use Kind with Aspire
Section titled “Why use Kind with Aspire”- Model the local cluster and its deployed resources in the AppHost.
- View the cluster, Helm charts, and manifests alongside other resources in the Aspire dashboard.
- Configure cluster lifetime so a cluster can either be removed at the end of a session or reused after an AppHost restart.
- Use
WithReferenceto pass the kubeconfig and cluster name to projects, executables, and containers. - Keep Kubernetes resources in local files or inline manifest content and make dependent resources wait for them.
How the integration fits into an Aspire app
Section titled “How the integration fits into an Aspire app”The integration supports two workflows. In the development workflow, the AppHost manages a Kind cluster and optionally deploys resources into it. In the deployment workflow, a Kubernetes environment configured with Kind backs aspire publish and aspire deploy.
flowchart LR
apphost[AppHost] --> cluster[Kind cluster]
cluster --> manifests[Kubernetes manifests]
cluster --> helm[Helm charts]
cluster --> workload[Local project or container]
environment[Kubernetes environment] --> kind[Kind compute target]
kind --> publish[aspire publish or aspire deploy]
Kind runs its Kubernetes nodes as containers. Kind-managed workloads use Kubernetes networking inside the cluster, which is separate from Aspire’s container network. See Networking and references before connecting Aspire containers to cluster resources.
Prerequisites
Section titled “Prerequisites”Install the tools needed for your workflow:
- Docker or Podman to run Kind nodes as containers.
- Kind CLI available on your
PATHto create and delete the cluster. - kubectl CLI to add Helm charts or apply manifest resources.
- Helm CLI to add Helm chart resources or use the Kind compute environment for deploy scenarios.
Install Docker or Podman, Kind, kubectl, and Helm.
Add a Kind cluster
Section titled “Add a Kind cluster”Install the 📦 CommunityToolkit.Aspire.Hosting.Kind package in your AppHost, then add a cluster resource:
aspire add communitytoolkit-kindThe Aspire CLI is interactive, be sure to select the appropriate search result when prompted:
Select an integration to add:
> communitytoolkit-kind (CommunityToolkit.Aspire.Hosting.Kind)> Other results listed as selectable options...#:package CommunityToolkit.Aspire.Hosting.Kind@*<PackageReference Include="CommunityToolkit.Aspire.Hosting.Kind" Version="*" />import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
await builder.addKindCluster('mycluster');
await builder.build().run();var builder = DistributedApplication.CreateBuilder(args);
var cluster = builder.AddKindCluster("mycluster");
// After adding all resources, run the app...builder.Build().Run();The integration provisions the cluster when the AppHost starts. By default, it attempts to delete the cluster during graceful shutdown or when its lifecycle hook is disposed. Cleanup is best-effort.
- Configure the cluster and add workloads. Set the Kubernetes version, worker count, and lifetime, then add Helm charts or manifests if needed.
- Reference the cluster from an AppHost resource to provide its kubeconfig to the resource.
- Use the Aspire dashboard to inspect the cluster and the status of its chart and manifest resources.