# StatefulSetPersistentVolumeClaimRetentionPolicyV1

- Kind: `class`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.3.0-preview.1.26254.5`
- Namespace: `Aspire.Hosting.Kubernetes.Resources`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/StatefulSetPersistentVolumeClaimRetentionPolicyV1.cs)

Represents the retention policy for PersistentVolumeClaims (PVCs) associated with a StatefulSet in Kubernetes.

## Definition

```csharp
namespace Aspire.Hosting.Kubernetes.Resources;

public sealed class StatefulSetPersistentVolumeClaimRetentionPolicyV1
{
    // ...
}
```

## Remarks

The StatefulSetPersistentVolumeClaimRetentionPolicyV1 class specifies the behavior of PersistentVolumeClaims when a StatefulSet is either deleted or scaled down. It defines retention behaviors through the properties WhenDeleted and WhenScaled.

## Constructors

- [StatefulSetPersistentVolumeClaimRetentionPolicyV1](/reference/api/csharp/aspire.hosting.kubernetes/statefulsetpersistentvolumeclaimretentionpolicyv1/constructors.md#constructor)

## Properties

- [WhenDeleted](/reference/api/csharp/aspire.hosting.kubernetes/statefulsetpersistentvolumeclaimretentionpolicyv1/properties.md#whendeleted) : `string?` `get; set` -- Gets or sets the policy that determines the retention behavior of PersistentVolumeClaims (PVCs) when a StatefulSet is deleted. This property defines how PVCs associated with the StatefulSet should be handled upon deletion of the StatefulSet resource.
- [WhenScaled](/reference/api/csharp/aspire.hosting.kubernetes/statefulsetpersistentvolumeclaimretentionpolicyv1/properties.md#whenscaled) : `string?` `get; set` -- Gets or sets the policy for handling Persistent Volume Claims (PVCs) when a StatefulSet is scaled. This property determines how PVCs are retained or deleted based on scaling operations for the StatefulSet.
