Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

KubernetesEnvironmentResource

Handle
📦 Aspire.Hosting.Kubernetes v13.6.5-preview.1.26559.7

Represents a Kubernetes environment resource that can host application resources.

type KubernetesEnvironmentResource interface {
ComputeEnvironmentResource
Resource
}

Properties

propertyDashboardEnabledboolget · set
Determines whether to include an Aspire dashboard for telemetry visualization in this environment.
DashboardEnabled() (bool, error)
SetDashboardEnabled(value bool) KubernetesEnvironmentResource
propertyDefaultImagePullPolicystringget · set
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".
DefaultImagePullPolicy() (string, error)
SetDefaultImagePullPolicy(value string) KubernetesEnvironmentResource
propertyDefaultServiceTypestringget · set
Gets or sets the default Kubernetes service type to be used when generating artifacts.
DefaultServiceType() (string, error)
SetDefaultServiceType(value string) KubernetesEnvironmentResource
propertyDefaultStorageClassName*stringget · set
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.
DefaultStorageClassName() (*string, error)
SetDefaultStorageClassName(value *string) KubernetesEnvironmentResource
propertyDefaultStorageReadWritePolicystringget · set
Gets or sets the default access policy for reading and writing to the storage.
DefaultStorageReadWritePolicy() (string, error)
SetDefaultStorageReadWritePolicy(value string) KubernetesEnvironmentResource
propertyDefaultStorageSizestringget · set
Gets or sets the default storage size for persistent volumes.
DefaultStorageSize() (string, error)
SetDefaultStorageSize(value string) KubernetesEnvironmentResource
propertyDefaultStorageTypestringget · set
Specifies the default type of storage used for Kubernetes deployments.
DefaultStorageType() (string, error)
SetDefaultStorageType(value string) KubernetesEnvironmentResource
propertyKubeConfigPath*stringget · set
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.
KubeConfigPath() (*string, error)
SetKubeConfigPath(value *string) KubernetesEnvironmentResource

Methods

methodAddCertManagerbuilder
Installs cert-manager into a Kubernetes environment
AddCertManager(
name string,
options ...*AddCertManagerOptions,
) CertManagerResource
namestringThe Aspire resource name for the cert-manager installation. Each call adds a uniquely-named resource to the application model, so multiple Kubernetes environments must each pass distinct names.
options...*AddCertManagerOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddCertManagerOptions argument.

ChartVersion*stringThe cert-manager Helm chart version to install. Defaults to a pinned version validated against this Aspire build.
CertManagerResource

The resource builder.

Returns a handle; failures surface later via Err().

methodAddGatewaybuilder
Adds a Kubernetes Gateway API Gateway resource to the application model as a child of the specified Kubernetes environment. The gateway generates a gateway.networking.k8s.io/v1 Gateway resource and one or more HTTPRoute resources in the Helm chart output at publish time.
AddGateway(name string) KubernetesGatewayResource
namestringThe name of the gateway resource.
KubernetesGatewayResource

The resource builder.

Returns a handle; failures surface later via Err().

methodAddHelmChartbuilder
Adds an external Helm chart to be installed in the Kubernetes environment. The chart is installed via helm upgrade --install as a pipeline step after the main application Helm chart is deployed.
AddHelmChart(
name string,
chartReference string,
chartVersion string,
) KubernetesHelmChartResource
namestringThe name of the Helm chart resource (used as release name and namespace if not overridden).
chartReferencestringThe Helm chart reference. Can be an OCI registry URL (e.g., oci://quay.io/jetstack/charts/cert-manager) or a chart name from an added repository.
chartVersionstringThe chart version to install.
KubernetesHelmChartResource

A resource builder for the Helm chart resource.

Returns a handle; failures surface later via Err().

methodAddIngressbuilder
Adds a Kubernetes Ingress resource to the application model as a child of the specified Kubernetes environment. The ingress generates a networking.k8s.io/v1 Ingress resource in the Helm chart output at publish time.
AddIngress(name string) KubernetesIngressResource
namestringThe name of the ingress resource. This is used as the Kubernetes resource name.
KubernetesIngressResource

The resource builder.

Returns a handle; failures surface later via Err().

methodAddNodePoolbuilder
Adds a named node pool to the Kubernetes environment.
AddNodePool(name string) KubernetesNodePoolResource
namestringThe name of the node pool. This value is used as the nodeSelector value.
KubernetesNodePoolResource

The resource builder.

Returns a handle; failures surface later via Err().

methodAddPersistentVolumebuilder
Adds a Kubernetes PersistentVolumeClaim resource
AddPersistentVolume(name string) KubernetesPersistentVolumeResource
namestringThe name of the persistent volume resource. Used as the generated PVC's metadata.name after lower-casing. To bind a workload using the name-match overload of WithPersistentVolume, add a WithVolume("name", "/path") on the workload using the same name.
KubernetesPersistentVolumeResource

A builder for the new KubernetesPersistentVolumeResource.

Returns a handle; failures surface later via Err().

methodConfigureDashboardbuilder
Configures the dashboard properties for this Kubernetes environment.
ConfigureDashboard(configure func(obj KubernetesAspireDashboardResource)) KubernetesEnvironmentResource
configurefunc(obj KubernetesAspireDashboardResource)callbackA method that can be used for customizing the dashboard resource.
KubernetesEnvironmentResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithDashboardbuilder
Enables the Aspire dashboard for telemetry visualization in this Kubernetes environment.
WithDashboard(options ...*WithDashboardOptions) KubernetesEnvironmentResource
options...*WithDashboardOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithDashboardOptions argument.

Enabled*boolWhether to enable the dashboard. Default is true.
KubernetesEnvironmentResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithHelmbuilder
Configures the Kubernetes environment to deploy using Helm charts.
WithHelm(options ...*WithHelmOptions) KubernetesEnvironmentResource
options...*WithHelmOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithHelmOptions argument.

Configurefunc(obj HelmChartOptions)callbackAn optional callback to configure Helm chart settings such as namespace, release name, and chart version.
KubernetesEnvironmentResource

The resource builder.

Returns a handle; failures surface later via Err().

methodWithPropertiesbuilder
Allows setting the properties of a Kubernetes environment resource.
WithProperties(configure func(obj KubernetesEnvironmentResource)) KubernetesEnvironmentResource
configurefunc(obj KubernetesEnvironmentResource)callbackA method that can be used for customizing the KubernetesEnvironmentResource.
KubernetesEnvironmentResource

The resource builder.

Returns a handle; failures surface later via Err().