# SecretKeySelectorV1 Properties

- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Type: [SecretKeySelectorV1](/reference/api/csharp/aspire.hosting.kubernetes/secretkeyselectorv1.md)
- Kind: `Properties`
- Members: `3`

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.

## Key

- Name: `Key`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/SecretKeySelectorV1.cs)

Specifies the key within the secret to select. This property is used to reference a specific key contained in a Kubernetes secret.

```csharp
public string Key { get; set; }
```

## Name

- Name: `Name`
- Modifiers: `get; set`
- Returns: `string`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/SecretKeySelectorV1.cs)

Gets or sets the name of the Kubernetes Secret to select the key from.

```csharp
public string Name { get; set; }
```

## Optional

- Name: `Optional`
- Modifiers: `nullable` `get; set`
- Returns: `bool?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/SecretKeySelectorV1.cs)

```csharp
public bool? Optional { get; set; }
```
