# SecretVolumeSourceV1

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

Represents a volume source based on a Kubernetes Secret.

## Definition

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

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

## Remarks

This class allows configuring a Secret as the data source for a Kubernetes volume. The SecretVolumeSourceV1 can be used to specify the secret name, default access permissions, and specific key-to-path mappings for projecting the contents of the secret into the volume. It also allows specifying whether the configuration is optional.

## Constructors

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

## Properties

- [DefaultMode](/reference/api/csharp/aspire.hosting.kubernetes/secretvolumesourcev1/properties.md#defaultmode) : `int?` `get; set` -- Gets or sets the default file mode for files created in the volume.
- [Items](/reference/api/csharp/aspire.hosting.kubernetes/secretvolumesourcev1/properties.md#items) : [List<KeyToPathV1>](/reference/api/csharp/aspire.hosting.kubernetes/keytopathv1.md) `get` -- Gets a list of key-to-path mappings that specify how individual keys within the secret should be projected into files within the volume.
- [Optional](/reference/api/csharp/aspire.hosting.kubernetes/secretvolumesourcev1/properties.md#optional) : `bool?` `get; set` -- Specifies whether the Secret or its keys must be defined.
- [SecretName](/reference/api/csharp/aspire.hosting.kubernetes/secretvolumesourcev1/properties.md#secretname) : `string` `get; set` -- Gets or sets the name of the Secret to be referenced as a volume.
