# LabelSelectorV1 Constructors

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

Represents a label selector for Kubernetes resources. A label selector is used to filter resources based on their labels, enabling selection of a specific set of objects in a dynamic way.

## LabelSelectorV1

- Name: `Constructor`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/LabelSelectorV1.cs#L26-L47)

Represents a label selector used to determine a set of resources in Kubernetes that match the defined criteria.

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

## Remarks

LabelSelectorV1 is commonly used in Kubernetes resource specifications where filtering objects based on labels is required, such as in ReplicaSets, Deployments, or custom metrics.

## LabelSelectorV1(Dictionary<string, string>)

- Name: `Constructor(Dictionary<string, string>)`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/LabelSelectorV1.cs#L26-L61)

Represents a label selector used to determine a set of resources in Kubernetes that match the defined criteria.

```csharp
public sealed class LabelSelectorV1
{
    public LabelSelectorV1(
        Dictionary<string, string> matchLabels)
    {
        // ...
    }
}
```

## Parameters

- `matchLabels` (`Dictionary<string, string>`)

## Remarks

LabelSelectorV1 is commonly used in Kubernetes resource specifications where filtering objects based on labels is required, such as in ReplicaSets, Deployments, or custom metrics.
