# 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/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/NodeAffinityV1.cs#L33-L46)

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