# Aspire.Hosting.Kubernetes

- Module: `Aspire.Hosting.Kubernetes`
- Version: `13.4.0-preview.1.26281.18`
- Source: [GitHub](https://github.com/microsoft/aspire)
- Functions: `52`
- Types: `13`

## Types

- [CertManagerIssuerResource](/reference/api/typescript/aspire.hosting.kubernetes/certmanagerissuerresource.md) -- `handle` - 7 members -- Represents a cert-manager `ClusterIssuer` resource in the Aspire application model.
- [CertManagerResource](/reference/api/typescript/aspire.hosting.kubernetes/certmanagerresource.md) -- `handle` - 1 members -- Represents a cert-manager installation on a Kubernetes environment.
- [HelmChartOptions](/reference/api/typescript/aspire.hosting.kubernetes/helmchartoptions.md) -- `handle` - 5 members -- Provides options for configuring Helm chart deployment settings on a {@ats-ref type:KubernetesEnvironmentResource}.
- [KubernetesAspireDashboardResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesaspiredashboardresource.md) -- `handle` - 5 members -- Represents a resource for the Aspire Dashboard deployed into a Kubernetes environment. This resource is used to visualize telemetry data from resources running in the cluster.
- [KubernetesEnvironmentResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesenvironmentresource.md) -- `handle` - 25 members -- Represents a Kubernetes environment resource that can host application resources.
- [KubernetesGatewayResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesgatewayresource.md) -- `handle` - 12 members -- Represents a Kubernetes Gateway API Gateway as a first-class resource in the Aspire application model. A Gateway defines listeners (ports, protocols, TLS) and HTTPRoutes attach to it for routing.
- [KubernetesHelmChartResource](/reference/api/typescript/aspire.hosting.kubernetes/kuberneteshelmchartresource.md) -- `handle` - 5 members -- Represents an external Helm chart to be installed into a Kubernetes environment. This resource models a Helm chart from a repository (OCI or HTTP) that will be installed as a pipeline step after the main application Helm chart is deployed.
- [KubernetesIngressResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesingressresource.md) -- `handle` - 12 members -- Represents a Kubernetes Ingress as a first-class resource in the Aspire application model. An Ingress defines HTTP routing rules that direct external traffic to services in the cluster.
- [KubernetesManifestResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesmanifestresource.md) -- `handle` - 4 members -- Represents an arbitrary Kubernetes manifest that is emitted with a Kubernetes service.
- [KubernetesNodePoolResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesnodepoolresource.md) -- `handle` - 0 members -- Represents a Kubernetes node pool as a child resource of a {@ats-ref type:KubernetesEnvironmentResource}. Node pools can be referenced by compute resources to schedule workloads on specific node pools using {@ats-ref method:KubernetesEnvironmentExtensions.withNodePool}.
- [KubernetesResource](/reference/api/typescript/aspire.hosting.kubernetes/kubernetesresource.md) -- `handle` - 2 members -- Represents a compute resource for Kubernetes.

## Functions

- [addCertManager](/reference/api/typescript/aspire.hosting.kubernetes/addcertmanager.md) -- `method` -- Installs cert-manager into a Kubernetes environment
- [addGateway](/reference/api/typescript/aspire.hosting.kubernetes/addgateway.md) -- `method` -- 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.
- [addHelmChart](/reference/api/typescript/aspire.hosting.kubernetes/addhelmchart.md) -- `method` -- 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.
- [addIngress](/reference/api/typescript/aspire.hosting.kubernetes/addingress.md) -- `method` -- 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.
- [addIssuer](/reference/api/typescript/aspire.hosting.kubernetes/addissuer.md) -- `method` -- Adds a cert-manager `ClusterIssuer` to this cert-manager installation.
- [addKubernetesEnvironment](/reference/api/typescript/aspire.hosting.kubernetes/addkubernetesenvironment.md) -- `method` -- Adds a Kubernetes environment to the application model.
- [addNodePool](/reference/api/typescript/aspire.hosting.kubernetes/addnodepool.md) -- `method` -- Adds a named node pool to the Kubernetes environment.
- [configureDashboard](/reference/api/typescript/aspire.hosting.kubernetes/configuredashboard.md) -- `method` -- Configures the dashboard properties for this Kubernetes environment.
- [publishAsKubernetesService](/reference/api/typescript/aspire.hosting.kubernetes/publishaskubernetesservice.md) -- `method` -- Publishes the specified resource as a Kubernetes service.
- [withAcmeServer](/reference/api/typescript/aspire.hosting.kubernetes/withacmeserver.md) -- `method` -- Configures the issuer to use a custom ACME directory endpoint (e.g., a private ACME server such as ZeroSSL or step-ca).
- [withAcmeServerParam](/reference/api/typescript/aspire.hosting.kubernetes/withacmeserverparam.md) -- `method` -- Configures the issuer to use a custom ACME directory endpoint with a parameterized email.
- [withDashboard](/reference/api/typescript/aspire.hosting.kubernetes/withdashboard.md) -- `method` -- Enables the Aspire dashboard for telemetry visualization in this Kubernetes environment.
- [withDefaultBackend](/reference/api/typescript/aspire.hosting.kubernetes/withdefaultbackend.md) -- `method` -- Sets the default backend for the ingress. The default backend handles requests that do not match any of the defined routing rules.
- [withForwardedHeaders](/reference/api/typescript/aspire.hosting.kubernetes/withforwardedheaders.md) -- `method` -- Configures whether forwarded headers processing is enabled for the Aspire dashboard container.
- [withGatewayAnnotation](/reference/api/typescript/aspire.hosting.kubernetes/withgatewayannotation.md) -- `method` -- Adds a Kubernetes metadata annotation to the generated Gateway resource.
- [withGatewayAnnotationParam](/reference/api/typescript/aspire.hosting.kubernetes/withgatewayannotationparam.md) -- `method` -- Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
- [withGatewayClass](/reference/api/typescript/aspire.hosting.kubernetes/withgatewayclass.md) -- `method` -- Sets the GatewayClass name that selects which controller implementation handles this gateway.
- [withGatewayClassParam](/reference/api/typescript/aspire.hosting.kubernetes/withgatewayclassparam.md) -- `method` -- Sets the GatewayClass name using a parameter that will be resolved at deploy time.
- [withGatewayHostnameParam](/reference/api/typescript/aspire.hosting.kubernetes/withgatewayhostnameparam.md) -- `method` -- Adds a hostname using a parameter that will be resolved at deploy time.
- [withGatewayHostRoute](/reference/api/typescript/aspire.hosting.kubernetes/withgatewayhostroute.md) -- `method` -- Adds a host-and-path-based routing rule to the gateway. The rule matches traffic for the specified host and path, routing it to the given endpoint's backing Kubernetes service. This generates an `HTTPRoute` resource with a `hostnames` filter.
- [withGatewayPathRoute](/reference/api/typescript/aspire.hosting.kubernetes/withgatewaypathroute.md) -- `method` -- Adds a path-based routing rule to the gateway. The rule matches all hosts and routes traffic matching the specified path to the given endpoint's backing Kubernetes service. This generates an `HTTPRoute` resource attached to the Gateway.
- [withGatewayTlsAuto](/reference/api/typescript/aspire.hosting.kubernetes/withgatewaytlsauto.md) -- `method` -- Configures TLS termination with an auto-generated secret name derived from the gateway name.
- [withGatewayTlsIssuer](/reference/api/typescript/aspire.hosting.kubernetes/withgatewaytlsissuer.md) -- `method` -- Adds an HTTPS listener to the gateway and wires it to the supplied cert-manager `ClusterIssuer`. This adds the `cert-manager.io/cluster-issuer` annotation to the generated Gateway resource, causing cert-manager to provision and renew a certificate for each gateway listener hostname.
- [withGatewayTlsParam](/reference/api/typescript/aspire.hosting.kubernetes/withgatewaytlsparam.md) -- `method` -- Configures TLS termination using a parameter for the secret name.
- [withHelm](/reference/api/typescript/aspire.hosting.kubernetes/withhelm.md) -- `method` -- Configures the Kubernetes environment to deploy using Helm charts.
- [withHelmChartDestroy](/reference/api/typescript/aspire.hosting.kubernetes/withhelmchartdestroy.md) -- `method` -- Opts the Helm chart in to destroy-time uninstall. When set, `aspire destroy` will run `helm uninstall` for this release as part of the destroy pipeline.
- [withHelmChartForceConflicts](/reference/api/typescript/aspire.hosting.kubernetes/withhelmchartforceconflicts.md) -- `method` -- Opts the Helm chart in to `helm upgrade --install --force-conflicts`. When set, Helm's server-side apply forcibly takes over any fields owned by another field manager instead of failing with a conflict.
- [withHelmChartNamespace](/reference/api/typescript/aspire.hosting.kubernetes/withhelmchartnamespace.md) -- `method` -- Sets the Kubernetes namespace for the Helm chart installation. If not set, the namespace defaults to the chart resource name.
- [withHelmChartReleaseName](/reference/api/typescript/aspire.hosting.kubernetes/withhelmchartreleasename.md) -- `method` -- Sets the Helm release name for the chart installation. If not set, the release name defaults to the resource name.
- [withHelmValue](/reference/api/typescript/aspire.hosting.kubernetes/withhelmvalue.md) -- `method` -- Sets a Helm value for the chart installation. Values are passed to `helm upgrade --install` via `--set` flags.
- [withHostname](/reference/api/typescript/aspire.hosting.kubernetes/withhostname.md) -- `method` -- Adds a hostname that this gateway's routes match. Multiple hostnames can be added by calling this method repeatedly. Hostnames are used as `hostnames` in generated `HTTPRoute` resources and as HTTPS listener hostnames when TLS is configured.
- [withHostname](/reference/api/typescript/aspire.hosting.kubernetes/withhostname.md) -- `method` -- Adds a hostname that this ingress matches. Multiple hostnames can be added by calling this method repeatedly. If no hostnames are configured, the ingress matches all hosts.
- [withHttp01Solver](/reference/api/typescript/aspire.hosting.kubernetes/withhttp01solver.md) -- `method` -- Adds an HTTP-01 ACME challenge solver to the issuer. cert-manager will satisfy the challenge by provisioning a temporary HTTP route at `/.well-known/acme-challenge/{token}` on the same hostname being validated. This requires the hostname to be publicly reachable on port 80.
- [withIngressAnnotation](/reference/api/typescript/aspire.hosting.kubernetes/withingressannotation.md) -- `method` -- Adds a Kubernetes metadata annotation to the generated Ingress resource. These are key-value pairs in the `metadata.annotations` field of the K8S Ingress, commonly used to configure ingress controller-specific behavior.
- [withIngressAnnotationParam](/reference/api/typescript/aspire.hosting.kubernetes/withingressannotationparam.md) -- `method` -- Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
- [withIngressClass](/reference/api/typescript/aspire.hosting.kubernetes/withingressclass.md) -- `method` -- Sets the Kubernetes ingress class name that selects which ingress controller handles this ingress resource.
- [withIngressClassParam](/reference/api/typescript/aspire.hosting.kubernetes/withingressclassparam.md) -- `method` -- Sets the Kubernetes ingress class name using a parameter that will be resolved at deploy time.
- [withIngressHostAndPath](/reference/api/typescript/aspire.hosting.kubernetes/withingresshostandpath.md) -- `method` -- Adds a host-scoped path rule to the ingress. The rule matches traffic for the specified host and path, forwarding it to the given endpoint's backing Kubernetes service.
- [withIngressHostnameParam](/reference/api/typescript/aspire.hosting.kubernetes/withingresshostnameparam.md) -- `method` -- Adds a hostname using a parameter that will be resolved at deploy time.
- [withIngressPath](/reference/api/typescript/aspire.hosting.kubernetes/withingresspath.md) -- `method` -- Adds a path-based rule to the ingress. The rule matches all hosts and forwards traffic matching the specified path to the given endpoint's backing Kubernetes service.
- [withIngressTlsAuto](/reference/api/typescript/aspire.hosting.kubernetes/withingresstlsauto.md) -- `method` -- Configures TLS termination with an auto-generated secret name derived from the ingress name.
- [withIngressTlsParam](/reference/api/typescript/aspire.hosting.kubernetes/withingresstlsparam.md) -- `method` -- Configures TLS termination using a parameter for the secret name.
- [withLetsEncryptProduction](/reference/api/typescript/aspire.hosting.kubernetes/withletsencryptproduction.md) -- `method` -- Configures the issuer to use the Let's Encrypt production ACME endpoint.
- [withLetsEncryptProductionParam](/reference/api/typescript/aspire.hosting.kubernetes/withletsencryptproductionparam.md) -- `method` -- Configures the issuer to use the Let's Encrypt production ACME endpoint, with the contact email supplied via a parameter resolved at deploy time.
- [withLetsEncryptStaging](/reference/api/typescript/aspire.hosting.kubernetes/withletsencryptstaging.md) -- `method` -- Configures the issuer to use the Let's Encrypt staging ACME endpoint. Certificates issued from staging are not trusted by browsers, but the endpoint has much higher rate limits, making it the right choice for development and CI workflows.
- [withLetsEncryptStagingParam](/reference/api/typescript/aspire.hosting.kubernetes/withletsencryptstagingparam.md) -- `method` -- Configures the issuer to use the Let's Encrypt staging ACME endpoint, with the contact email supplied via a parameter resolved at deploy time.
- [withNodePool](/reference/api/typescript/aspire.hosting.kubernetes/withnodepool.md) -- `method` -- Schedules a compute resource's workload on the specified Kubernetes node pool. This translates to a Kubernetes `nodeSelector` in the pod specification targeting the named node pool.
- [withOtlpServicePort](/reference/api/typescript/aspire.hosting.kubernetes/withotlpserviceport.md) -- `method` -- Sets the Kubernetes Service ports for the Aspire Dashboard OTLP endpoints.
- [withProperties](/reference/api/typescript/aspire.hosting.kubernetes/withproperties.md) -- `method` -- Allows setting the properties of a Kubernetes environment resource.
- [withServicePort](/reference/api/typescript/aspire.hosting.kubernetes/withserviceport.md) -- `method` -- Sets the Kubernetes Service port for the Aspire Dashboard HTTP endpoint.
- [withTls](/reference/api/typescript/aspire.hosting.kubernetes/withtls.md) -- `method` -- Configures TLS on a Kubernetes Gateway listener
- [withTls](/reference/api/typescript/aspire.hosting.kubernetes/withtls.md) -- `method` -- Configures TLS for a Kubernetes Ingress using a K8S secret

## Enums

- [GatewayPathMatchType](/reference/api/typescript/aspire.hosting.kubernetes/gatewaypathmatchtype.md) -- `enum` - 3 values -- Specifies the type of path matching used in a Kubernetes Gateway API `HTTPRoute` rule. The values map directly to the `matches[].path.type` field defined by the Gateway API (see ) and are distinct from the Ingress-flavoured `IngressPathType` because the two specs use different vocabularies (Ingress: `Prefix`, Gateway: `PathPrefix`).
- [IngressPathType](/reference/api/typescript/aspire.hosting.kubernetes/ingresspathtype.md) -- `enum` - 3 values -- Specifies the type of path matching used in a Kubernetes Ingress rule.
