# WeightedPodAffinityTermV1

- 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/WeightedPodAffinityTermV1.cs)

Represents a weighted pod affinity term used in Kubernetes scheduling policies. WeightedPodAffinityTermV1 defines a preference for scheduling pods closer to other pods based on affinity/anti-affinity rules.

## Definition

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

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

## Remarks

This class is typically utilized in scenarios where a Kubernetes scheduler prioritizes certain affinities while allowing flexibility in placement. The weight determines the level of preference for the associated PodAffinityTermV1.

## Constructors

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

## Properties

- [PodAffinityTerm](/reference/api/csharp/aspire.hosting.kubernetes/weightedpodaffinitytermv1/properties.md#podaffinityterm) : [PodAffinityTermV1](/reference/api/csharp/aspire.hosting.kubernetes/podaffinitytermv1.md) `get; set` -- Represents the pod affinity or anti-affinity requirement used in Kubernetes scheduling. This property is used to define rules that influence pod placement based on the labels, namespaces, and topology keys of other pods in a cluster.
- [Weight](/reference/api/csharp/aspire.hosting.kubernetes/weightedpodaffinitytermv1/properties.md#weight) : `int` `get; set` -- Gets or sets the weight associated with the pod affinity term. The weight indicates the importance of the term relative to other terms. A higher weight implies a stronger preference or priority for satisfying the associated pod affinity term.
