# HorizontalPodAutoscalerV2 Constructors

- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Type: [HorizontalPodAutoscalerV2](/reference/api/csharp/aspire.hosting.kubernetes/horizontalpodautoscalerv2.md)
- Kind: `Constructors`
- Members: `1`

Represents a Kubernetes resource for Horizontal Pod Autoscaling (HPA) under the autoscaling/v2 API version.

## HorizontalPodAutoscalerV2

- Name: `Constructor`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/HorizontalPodAutoscalerV2.cs#L17-L28)

Represents a Kubernetes resource for Horizontal Pod Autoscaling (HPA) under the autoscaling/v2 API version.

```csharp
public sealed class HorizontalPodAutoscalerV2
{
    public HorizontalPodAutoscalerV2()
    {
        // ...
    }
}
```

## Remarks

The HorizontalPodAutoscalerV2 class is responsible for defining and managing the behavior of the HPA, which automatically adjusts the number of pods in a deployment, replica set, or stateful set based on metrics and thresholds. It extends BaseKubernetesResource to include additional properties specific to the HPA specification as defined in Kubernetes.
