# SecretKeySelectorV1

- Kind: `class`
- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Version: `13.4.0-preview.1.26281.18`
- Namespace: `Aspire.Hosting.Kubernetes.Resources`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/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`
