# EnvVarV1

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

EnvVarV1 represents an environment variable in a Kubernetes resource. It is used to define key-value pairs or to derive values from other Kubernetes resources through a configurable source.

## Definition

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

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

## Remarks

EnvVarV1 contains properties to define the name and value of the environment variable directly, or to set the value dynamically using a source, such as a ConfigMap, Secret, or Field reference.

## Constructors

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

## Properties

- [Name](/reference/api/csharp/aspire.hosting.kubernetes/envvarv1/properties.md#name) : `string` `get; set` -- Gets or sets the name of the environment variable. This property specifies the name of the environment variable and is a required field.
- [Value](/reference/api/csharp/aspire.hosting.kubernetes/envvarv1/properties.md#value) : `string` `get; set` -- Gets or sets the literal value of the environment variable. This property is used to specify a constant string value that will be set directly as the environment variable's value in the container configuration.
- [ValueFrom](/reference/api/csharp/aspire.hosting.kubernetes/envvarv1/properties.md#valuefrom) : [EnvVarSourceV1?](/reference/api/csharp/aspire.hosting.kubernetes/envvarsourcev1.md) `get; set` -- Gets or sets the source for the environment variable value. This property allows specifying an external source from which the environment variable value will be derived, such as a key in a ConfigMap, a field reference from the object's metadata, a resource field (e.g., limits or requests for memory or CPU), or a key in a Secret.
