# KindHelmChartResourceBuilderExtensions Methods

- Package: [CommunityToolkit.Aspire.Hosting.Kind](/reference/api/csharp/communitytoolkit.aspire.hosting.kind.md)
- Type: [KindHelmChartResourceBuilderExtensions](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindhelmchartresourcebuilderextensions.md)
- Kind: `Methods`
- Members: `7`

Extension methods for adding Helm chart resources to Kind clusters.

<a id="addhelmchart"></a>
<a id="addhelmchart-iresourcebuilder-kindclusterresource-string-string"></a>

## AddHelmChart(IResourceBuilder<KindClusterResource>, string, string)

- Name: `AddHelmChart(IResourceBuilder<KindClusterResource>, string, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<KindHelmChartResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/2c26a4c9649531d17fce3cbc4c5dea00d61d279c/src/CommunityToolkit.Aspire.Hosting.Kind/KindHelmChartResourceBuilderExtensions.cs#L36-L115)

Adds a Helm chart to be deployed to the Kind cluster.

```csharp
public static class KindHelmChartResourceBuilderExtensions
{
    public static IResourceBuilder<KindHelmChartResource> AddHelmChart(
        this IResourceBuilder<KindClusterResource> builder,
        string name,
        string chartRef)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<KindClusterResource>`)
  The Kind cluster resource builder.
- `name` (`string`)
  The name of the Helm release.
- `chartRef` (`string`)
  Chart reference passed to `helm install`. Any form Helm supports: OCI ( `oci://registry/chart`), repo ( `repo/chart`), or local path ( `./charts/my-app`).

## Returns

`IResourceBuilder<KindHelmChartResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withchartversion"></a>
<a id="withchartversion-iresourcebuilder-kindhelmchartresource-string"></a>

## WithChartVersion(IResourceBuilder<KindHelmChartResource>, string)

- Name: `WithChartVersion(IResourceBuilder<KindHelmChartResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<KindHelmChartResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/2c26a4c9649531d17fce3cbc4c5dea00d61d279c/src/CommunityToolkit.Aspire.Hosting.Kind/KindHelmChartResourceBuilderExtensions.cs#L129-L133)

Sets the chart version (maps to `helm install --version`).

```csharp
public static class KindHelmChartResourceBuilderExtensions
{
    public static IResourceBuilder<KindHelmChartResource> WithChartVersion(
        this IResourceBuilder<KindHelmChartResource> builder,
        string version)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<KindHelmChartResource>`)
  The Helm chart resource builder.
- `version` (`string`)
  The chart version.

## Returns

`IResourceBuilder<KindHelmChartResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withcrdwaitretry"></a>
<a id="withcrdwaitretry-iresourcebuilder-kindhelmchartresource-int-timespan-timespan"></a>

## WithCrdWaitRetry(IResourceBuilder<KindHelmChartResource>, int, TimeSpan?, TimeSpan?)

- Name: `WithCrdWaitRetry(IResourceBuilder<KindHelmChartResource>, int, TimeSpan?, TimeSpan?)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<KindHelmChartResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/2c26a4c9649531d17fce3cbc4c5dea00d61d279c/src/CommunityToolkit.Aspire.Hosting.Kind/KindHelmChartResourceBuilderExtensions.cs#L213-L219)

Retries Helm installs that race newly-created CRDs which have not reached the `Established` condition yet.

```csharp
public static class KindHelmChartResourceBuilderExtensions
{
    public static IResourceBuilder<KindHelmChartResource> WithCrdWaitRetry(
        this IResourceBuilder<KindHelmChartResource> builder,
        int maxAttempts = 3,
        TimeSpan? backoff = null,
        TimeSpan? crdWaitTimeout = null)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<KindHelmChartResource>`)
  The Helm chart resource builder.
- `maxAttempts` (`int`) `optional`
  The total number of install attempts. Must be 2 or greater.
- `backoff` (`TimeSpan?`) `optional`
  The initial delay before retrying. Later retries back off exponentially. When `null`, Kind uses a 5 second initial backoff.
- `crdWaitTimeout` (`TimeSpan?`) `optional`
  The timeout used while waiting for newly discovered CRDs to become `Established` between retry attempts. When `null`, Kind uses a 5 minute timeout.

## Returns

`IResourceBuilder<KindHelmChartResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## Remarks

This is useful for charts that create CRDs and immediately render custom resources that depend on those CRDs. Between attempts, Kind waits for newly observed CRDs to report `Established`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withhelmstringvalue"></a>
<a id="withhelmstringvalue-iresourcebuilder-kindhelmchartresource-string-string"></a>

## WithHelmStringValue(IResourceBuilder<KindHelmChartResource>, string, string)

- Name: `WithHelmStringValue(IResourceBuilder<KindHelmChartResource>, string, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<KindHelmChartResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/2c26a4c9649531d17fce3cbc4c5dea00d61d279c/src/CommunityToolkit.Aspire.Hosting.Kind/KindHelmChartResourceBuilderExtensions.cs#L177-L183)

Sets a Helm value while preserving it as a string (maps to `helm install --set-string key=value`).

```csharp
public static class KindHelmChartResourceBuilderExtensions
{
    public static IResourceBuilder<KindHelmChartResource> WithHelmStringValue(
        this IResourceBuilder<KindHelmChartResource> builder,
        string key,
        string value)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<KindHelmChartResource>`)
  The Helm chart resource builder.
- `key` (`string`)
  The Helm value key.
- `value` (`string`)
  The Helm value.

## Returns

`IResourceBuilder<KindHelmChartResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## Remarks

Use this overload when Helm would otherwise coerce the value into a numeric, boolean, or other non-string type. If the same key was previously configured with [KindHelmChartResourceBuilderExtensions.WithHelmValue(IResourceBuilder<KindHelmChartResource>, string, string)](/reference/api/csharp/communitytoolkit.aspire.hosting.kind/kindhelmchartresourcebuilderextensions/methods.md#withhelmvalue-iresourcebuilder-kindhelmchartresource-string-string), the string-preserving value replaces it.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withhelmvalue"></a>
<a id="withhelmvalue-iresourcebuilder-kindhelmchartresource-string-string"></a>

## WithHelmValue(IResourceBuilder<KindHelmChartResource>, string, string)

- Name: `WithHelmValue(IResourceBuilder<KindHelmChartResource>, string, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<KindHelmChartResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/2c26a4c9649531d17fce3cbc4c5dea00d61d279c/src/CommunityToolkit.Aspire.Hosting.Kind/KindHelmChartResourceBuilderExtensions.cs#L149-L155)

Sets a Helm value (maps to `helm install --set key=value`).

```csharp
public static class KindHelmChartResourceBuilderExtensions
{
    public static IResourceBuilder<KindHelmChartResource> WithHelmValue(
        this IResourceBuilder<KindHelmChartResource> builder,
        string key,
        string value)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<KindHelmChartResource>`)
  The Helm chart resource builder.
- `key` (`string`)
  The Helm value key.
- `value` (`string`)
  The Helm value.

## Returns

`IResourceBuilder<KindHelmChartResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withhelmvaluesfile"></a>
<a id="withhelmvaluesfile-iresourcebuilder-kindhelmchartresource-string"></a>

## WithHelmValuesFile(IResourceBuilder<KindHelmChartResource>, string)

- Name: `WithHelmValuesFile(IResourceBuilder<KindHelmChartResource>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<KindHelmChartResource>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/2c26a4c9649531d17fce3cbc4c5dea00d61d279c/src/CommunityToolkit.Aspire.Hosting.Kind/KindHelmChartResourceBuilderExtensions.cs#L233-L237)

Adds a values file (maps to `helm install -f path`).

```csharp
public static class KindHelmChartResourceBuilderExtensions
{
    public static IResourceBuilder<KindHelmChartResource> WithHelmValuesFile(
        this IResourceBuilder<KindHelmChartResource> builder,
        string path)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<KindHelmChartResource>`)
  The Helm chart resource builder.
- `path` (`string`)
  The path to the values file.

## Returns

`IResourceBuilder<KindHelmChartResource>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.

<a id="withnamespace"></a>
<a id="withnamespace-iresourcebuilder-t-string"></a>

## WithNamespace(IResourceBuilder<T>, string)

- Name: `WithNamespace(IResourceBuilder<T>, string)`
- Modifiers: `extension`
- Returns: `IResourceBuilder<T>`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/blob/2c26a4c9649531d17fce3cbc4c5dea00d61d279c/src/CommunityToolkit.Aspire.Hosting.Kind/KindHelmChartResourceBuilderExtensions.cs#L257-L261)

Sets the Kubernetes namespace for the deployment.

```csharp
public static class KindHelmChartResourceBuilderExtensions
{
    public static IResourceBuilder<T> WithNamespace<T>(
        this IResourceBuilder<T> builder,
        string @namespace)
    {
        // ...
    }
}
```

## Parameters

- `builder` (`IResourceBuilder<T>`)
  The resource builder.
- `namespace` (`string`)
  The Kubernetes namespace.

## Returns

`IResourceBuilder<T>` -- A reference to the `ApplicationModel.IResourceBuilder`1`.

## Remarks

Helm chart resources pass `--create-namespace`. Manifest resources only pass `--namespace` to `kubectl apply`; they do not create the namespace.

## ATS metadata

### ATS export

- Available to Polyglot AppHosts through the Aspire Type System.
