# FileKeySelectorV1 Properties

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

Selects a key from an environment variable file in a pod's emptyDir volume.

<a id="key"></a>

## Key

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

Gets or sets the key whose value is selected from the environment variable file. Keys may contain printable ASCII characters except `=`. An invalid key prevents the pod from starting. In Kubernetes 1.34, where EnvFiles is alpha, keys are limited to 128 characters.

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

<a id="optional"></a>

## Optional

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

Gets or sets whether the file or key may be absent. When true, a missing file or key leaves the environment variable unset. When false or unspecified, a missing file or key prevents the container from starting.

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

<a id="path"></a>

## Path

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

Gets or sets the file path relative to the volume root. The path must not contain a parent directory component or start with `..`.

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

<a id="volumename"></a>

## VolumeName

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

Gets or sets the name of the emptyDir volume containing the environment variable file.

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