# YarpClusterExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Yarp](/reference/api/csharp/aspire.hosting.yarp.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Yarp`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpCluster.cs)

Provides extension methods for configuring a YARP cluster.

## Definition

```csharp
namespace Aspire.Hosting.Yarp;

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

## Methods

- [WithForwarderRequestConfig(YarpCluster, ForwarderRequestConfig)](/reference/api/csharp/aspire.hosting.yarp/yarpclusterextensions/methods.md#withforwarderrequestconfig-yarpcluster-forwarderrequestconfig) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `extension` `ats ignored` -- Set the ForwarderRequestConfig for the cluster.
- [WithHealthCheckConfig(YarpCluster, HealthCheckConfig)](/reference/api/csharp/aspire.hosting.yarp/yarpclusterextensions/methods.md#withhealthcheckconfig-yarpcluster-healthcheckconfig) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `extension` `ats ignored` -- Set the HealthCheckConfig for the cluster.
- [WithHttpClientConfig(YarpCluster, HttpClientConfig)](/reference/api/csharp/aspire.hosting.yarp/yarpclusterextensions/methods.md#withhttpclientconfig-yarpcluster-httpclientconfig) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `extension` `ats ignored` -- Set the ForwarderRequestConfig for the cluster.
- [WithLoadBalancingPolicy(YarpCluster, string)](/reference/api/csharp/aspire.hosting.yarp/yarpclusterextensions/methods.md#withloadbalancingpolicy-yarpcluster-string) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `extension` `ats export` -- Set the LoadBalancingPolicy for the cluster.
- [WithMetadata(YarpCluster, IReadOnlyDictionary<string, string>)](/reference/api/csharp/aspire.hosting.yarp/yarpclusterextensions/methods.md#withmetadata-yarpcluster-ireadonlydictionary-string-string) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `extension` `ats export` -- Set the Metadata for the cluster.
- [WithSessionAffinityConfig(YarpCluster, SessionAffinityConfig)](/reference/api/csharp/aspire.hosting.yarp/yarpclusterextensions/methods.md#withsessionaffinityconfig-yarpcluster-sessionaffinityconfig) : [YarpCluster](/reference/api/csharp/aspire.hosting.yarp/yarpcluster.md) `extension` `ats ignored` -- Set the SessionAffinityConfig for the cluster.
