KubernetesEnvironmentResource
Handle
interface KubernetesEnvironmentResource extends IComputeEnvironmentResource, IComputeEnvironmentWithVolumeMounts, IResource { dashboardEnabled: boolean; defaultImagePullPolicy: string; defaultServiceType: string; defaultStorageClassName: string; defaultStorageReadWritePolicy: string; defaultStorageSize: string; defaultStorageType: string; kubeConfigPath: string; readonly resourceTypeDisplayName: string; addCertManager( name: string, chartVersion?: string): CertManagerResource; addGateway(name: string): KubernetesGatewayResource; addHelmChart( name: string, chartReference: string, chartVersion: string): KubernetesHelmChartResource; addIngress(name: string): KubernetesIngressResource; addNodePool(name: string): KubernetesNodePoolResource; addPersistentVolume(name: string): KubernetesPersistentVolumeResource; configureDashboard(configure: (obj: KubernetesAspireDashboardResource) => Promise<void>): KubernetesEnvironmentResource; withDashboard(enabled?: boolean): KubernetesEnvironmentResource; withHelm(configure?: (obj: HelmChartOptions) => Promise<void>): KubernetesEnvironmentResource; withProperties(configure: (obj: KubernetesEnvironmentResource) => Promise<void>): KubernetesEnvironmentResource;}27 members
Properties
property
dashboardEnabled booleanget · setDetermines whether to include an Aspire dashboard for telemetry visualization in this environment.
property
defaultImagePullPolicy stringget · setGets 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".
property
defaultServiceType stringget · setGets or sets the default Kubernetes service type to be used when generating artifacts.
property
defaultStorageClassName stringget · setSpecifies 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.
property
defaultStorageReadWritePolicy stringget · setGets or sets the default access policy for reading and writing to the storage.
property
defaultStorageSize stringget · setGets or sets the default storage size for persistent volumes.
property
defaultStorageType stringget · setSpecifies the default type of storage used for Kubernetes deployments.
property
kubeConfigPath stringget · setGets 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`.
property
resourceTypeDisplayName stringgetGets the ResourceTypeDisplayName property
Methods
Installs cert-manager into a Kubernetes environment
addCertManager( name: string, chartVersion?: string): CertManagerResourceParameters
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.chartVersion stringoptionalThe cert-manager Helm chart version to install. Defaults to a pinned version validated against this Aspire build.Returns
CertManagerResource 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): KubernetesGatewayResourceParameters
namestringThe name of the gateway resource.Returns
KubernetesGatewayResource 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): KubernetesHelmChartResourceParameters
namestringThe name of the Helm chart resource (used as release name and namespace if not overridden).chartReference stringThe 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.chartVersion stringThe chart version to install.Returns
KubernetesHelmChartResource 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): KubernetesIngressResourceParameters
namestringThe name of the ingress resource. This is used as the Kubernetes resource name.Returns
KubernetesIngressResource Adds a named node pool to the Kubernetes environment.
addNodePool(name: string): KubernetesNodePoolResourceParameters
namestringThe name of the node pool. This value is used as the `nodeSelector` value.Returns
KubernetesNodePoolResource Adds a Kubernetes PersistentVolumeClaim resource
addPersistentVolume(name: string): KubernetesPersistentVolumeResourceParameters
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``1`, add a `WithVolume("name", "/path")` on the workload using the same `name`.Returns
KubernetesPersistentVolumeResource Configures the dashboard properties for this Kubernetes environment.
configureDashboard(configure: (obj: KubernetesAspireDashboardResource) => Promise<void>): KubernetesEnvironmentResourceParameters
configure(obj: KubernetesAspireDashboardResource) => Promise<void> A method that can be used for customizing the dashboard resource.Returns
KubernetesEnvironmentResource Enables the Aspire dashboard for telemetry visualization in this Kubernetes environment.
withDashboard(enabled?: boolean): KubernetesEnvironmentResourceParameters
enabledbooleanoptional= TrueWhether to enable the dashboard. Default is true.Returns
KubernetesEnvironmentResource Configures the Kubernetes environment to deploy using Helm charts.
withHelm(configure?: (obj: HelmChartOptions) => Promise<void>): KubernetesEnvironmentResourceParameters
configure(obj: HelmChartOptions) => Promise<void> optionalAn optional callback to configure Helm chart settings such as namespace, release name, and chart version.Returns
KubernetesEnvironmentResource Allows setting the properties of a Kubernetes environment resource.
withProperties(configure: (obj: KubernetesEnvironmentResource) => Promise<void>): KubernetesEnvironmentResourceParameters
configure(obj: KubernetesEnvironmentResource) => Promise<void> A method that can be used for customizing the `KubernetesEnvironmentResource`.Returns
KubernetesEnvironmentResource