# SecretKeySelectorV1

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

SecretKeySelectorV1 represents a reference to a specific key within a Secret in Kubernetes. It is used to identify and optionally retrieve the key's value from a named Secret resource.

## Definition

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

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

## Constructors

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

## Properties

- [Key](/reference/api/csharp/aspire.hosting.kubernetes/secretkeyselectorv1/properties.md#key) : `string` `get; set` -- Specifies the key within the secret to select. This property is used to reference a specific key contained in a Kubernetes secret.
- [Name](/reference/api/csharp/aspire.hosting.kubernetes/secretkeyselectorv1/properties.md#name) : `string` `get; set` -- Gets or sets the name of the Kubernetes Secret to select the key from.
- [Optional](/reference/api/csharp/aspire.hosting.kubernetes/secretkeyselectorv1/properties.md#optional) : `bool?` `get; set`
