# NodeAffinityV1 Constructors

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

Represents node affinity scheduling configuration for Kubernetes pods. This class defines the rules to determine node selection for a pod during scheduling. Node affinity allows a pod to specify constraints that limit the set of nodes it can be scheduled onto. This includes both hard requirements (requiredDuringSchedulingIgnoredDuringExecution) and soft preferences (preferredDuringSchedulingIgnoredDuringExecution).

## NodeAffinityV1

- Name: `Constructor`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Kubernetes/Resources/NodeAffinityV1.cs#L33-L46)

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