# NodeSelectorRequirementV1

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

Represents a node selector requirement used to constrain a set of nodes in Kubernetes.

## Definition

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

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

## Remarks

NodeSelectorRequirementV1 defines a selector requirement as a key-value pair with an operator and an optional set of values. It is typically used in node affinity rules to determine eligibility of nodes for scheduling a workload.

## Constructors

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

## Properties

- [Key](/reference/api/csharp/aspire.hosting.kubernetes/nodeselectorrequirementv1/properties.md#key) : `string` `get; set` -- Specifies the key that is used to match against node labels or attributes.
- [Operator](/reference/api/csharp/aspire.hosting.kubernetes/nodeselectorrequirementv1/properties.md#operator) : `string` `get; set` -- Gets or sets the operator used in the node selection requirement. The operator specifies the key’s relationship to a set of values. Examples include "In", "NotIn", "Exists", or "DoesNotExist".
- [Values](/reference/api/csharp/aspire.hosting.kubernetes/nodeselectorrequirementv1/properties.md#values) : `List<string>` `get` -- Gets a collection of values used in the node selector requirements for specifying constraints.
