# KindClusterResourceBuilderExtensions

- Kind: `class`
- Package: [CommunityToolkit.Aspire.Hosting.Kind](/reference/api/csharp/communitytoolkit.aspire.hosting.kind.md)
- Version: `13.4.1-beta.706`
- Namespace: `Aspire.Hosting`
- Target framework: `net10.0`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/d479e13473b1d29d06b974f144a0049289a3cb5c/src/CommunityToolkit.Aspire.Hosting.Kind/KindClusterResourceBuilderExtensions.cs)

Extension methods for adding Kind cluster resources to the distributed application builder.

## Definition

```csharp
namespace Aspire.Hosting;

public static class KindClusterResourceBuilderExtensions
{
    // ...
}
```

## Methods

- [AddKindCluster(IDistributedApplicationBuilder, string)](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindclusterresourcebuilderextensions/methods.md#addkindcluster-idistributedapplicationbuilder-string) : `IResourceBuilder<KindClusterResource>` `extension` `ats export` -- Adds a Kind cluster resource to the application model.
- [WithClusterLifetime(IResourceBuilder<T>, ClusterLifetime)](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindclusterresourcebuilderextensions/methods.md#withclusterlifetime-iresourcebuilder-t-clusterlifetime) : `IResourceBuilder<T>` `extension` `ats export` -- Sets the cluster lifetime. When [ClusterLifetime.Session](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/clusterlifetime/fields.md) (the default), the cluster is deleted when the AppHost shuts down. When [ClusterLifetime.Persistent](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/clusterlifetime/fields.md), the cluster survives AppHost restarts and is reused on next startup.
- [WithKindConfig(IResourceBuilder<KindClusterResource>, Action<KindConfigModel>)](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindclusterresourcebuilderextensions/methods.md#withkindconfig-iresourcebuilder-kindclusterresource-action-kindconfigmodel) : `IResourceBuilder<KindClusterResource>` `extension` `ats ignored` -- Customizes the Kind cluster configuration. The callback receives the [KindConfigModel](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindconfigmodel.md) after default nodes have been populated, allowing arbitrary modifications before serialization to YAML.
- [WithKubernetesVersion(IResourceBuilder<T>, string)](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindclusterresourcebuilderextensions/methods.md#withkubernetesversion-iresourcebuilder-t-string) : `IResourceBuilder<T>` `extension` `ats export` -- Sets the Kubernetes version for the Kind cluster.
- [WithReference(IResourceBuilder<T>, IResourceBuilder<KindClusterResource>)](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindclusterresourcebuilderextensions/methods.md#withreference-iresourcebuilder-t-iresourcebuilder-kindclusterresource) : `IResourceBuilder<T>` `extension` `ats export` -- Configures a non-container resource to reference the Kind cluster by injecting kubeconfig environment variables.
- [WithWorkerNodes(IResourceBuilder<T>, int)](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindclusterresourcebuilderextensions/methods.md#withworkernodes-iresourcebuilder-t-int) : `IResourceBuilder<T>` `extension` `ats export` -- Sets the number of worker nodes for the Kind cluster.
