# KubernetesEnvironmentResource Properties

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

Represents a Kubernetes environment resource that can host application resources.

## DashboardEnabled

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

Determines whether to include an Aspire dashboard for telemetry visualization in this environment.

```csharp
public bool DashboardEnabled { get; set; }
```

## DefaultImagePullPolicy

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

Gets or sets the default policy that determines how Docker images are pulled during deployment. Possible values are: "Always" - Always attempt to pull the image from the registry. "IfNotPresent" - Pull the image only if it is not already present locally. "Never" - Never pull the image, use only the local image. The default value is "IfNotPresent".

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

## DefaultServiceType

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

Gets or sets the default Kubernetes service type to be used when generating artifacts.

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

## Remarks

The default value is "ClusterIP". This property determines the type of service (e.g., ClusterIP, NodePort, LoadBalancer) created in Kubernetes for the application.

## DefaultStorageClassName

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

Specifies the default name of the storage class to be used for persistent volume claims in Kubernetes. This property allows customization of the storage class for specifying storage requirements such as performance, retention policies, and provisioning parameters. If set to null, the default storage class for the cluster will be used.

```csharp
public string? DefaultStorageClassName { get; set; }
```

## DefaultStorageReadWritePolicy

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

Gets or sets the default access policy for reading and writing to the storage.

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

## DefaultStorageSize

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

Gets or sets the default storage size for persistent volumes.

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

## DefaultStorageType

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

Specifies the default type of storage used for Kubernetes deployments.

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

## Remarks

This property determines the storage medium used for the application. Possible values include "emptyDir", "hostPath", "pvc"

## HelmChartDescription

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

Gets or sets the description of the Helm chart being generated.

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

## HelmChartName

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

Gets or sets the name of the Helm chart to be generated.

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

## HelmChartVersion

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

Gets or sets the version of the Helm chart to be generated. This property specifies the version number that will be assigned to the Helm chart, typically following semantic versioning conventions.

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

## KubeConfigPath

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

Gets or sets the path to an explicit kubeconfig file for Helm and kubectl commands. When set, all Helm and kubectl commands will use `--kubeconfig` to target this file instead of the default `~/.kube/config`.

```csharp
public string? KubeConfigPath { get; set; }
```

## Remarks

This is used by Azure Kubernetes Service (AKS) integration to isolate credentials fetched via `az aks get-credentials` from the user's default kubectl context.

## OwningComputeEnvironment

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

Gets or sets the parent compute environment resource that owns this Kubernetes environment. When set, resources with `WithComputeEnvironment` targeting the parent will also be processed by this Kubernetes environment.

```csharp
public IComputeEnvironmentResource? OwningComputeEnvironment { get; set; }
```

## Remarks

This is used by Azure Kubernetes Service (AKS) integration where the user calls `WithComputeEnvironment(aksEnv)` but the inner `KubernetesEnvironmentResource` needs to process the resource.
