Skip to content
Docs Try Aspire
Docs Try

Aspire.Hosting.Kubernetes

Official
📦 Aspire.Hosting.Kubernetes v13.4.0-preview.1.26281.18
52 Functions
13 Types

Types

Functions

method addCertManager builder
Installs cert-manager into a Kubernetes environment
addCertManager(name: string, chartVersion?: string): CertManagerResource
method addGateway builder
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
method addHelmChart builder
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
method addIngress builder
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
method addIssuer builder
Adds a cert-manager `ClusterIssuer` to this cert-manager installation.
addIssuer(name: string): CertManagerIssuerResource
method addKubernetesEnvironment builder
Adds a Kubernetes environment to the application model.
addKubernetesEnvironment(name: string): KubernetesEnvironmentResource
method addNodePool builder
Adds a named node pool to the Kubernetes environment.
addNodePool(name: string): KubernetesNodePoolResource
method configureDashboard builder
Configures the dashboard properties for this Kubernetes environment.
configureDashboard(configure: (obj: KubernetesAspireDashboardResource) => Promise<void>): KubernetesEnvironmentResource
method publishAsKubernetesService builder
Publishes the specified resource as a Kubernetes service.
publishAsKubernetesService(configure: (obj: KubernetesResource) => Promise<void>): IComputeResource
method withAcmeServer builder
Configures the issuer to use a custom ACME directory endpoint (e.g., a private ACME server such as ZeroSSL or step-ca).
withAcmeServer(serverUrl: string, email: string): CertManagerIssuerResource
method withAcmeServerParam builder
Configures the issuer to use a custom ACME directory endpoint with a parameterized email.
withAcmeServerParam(serverUrl: string, email: ParameterResource): CertManagerIssuerResource
method withDashboard builder
Enables the Aspire dashboard for telemetry visualization in this Kubernetes environment.
withDashboard(enabled?: boolean): KubernetesEnvironmentResource
method withDefaultBackend builder
Sets the default backend for the ingress. The default backend handles requests that do not match any of the defined routing rules.
withDefaultBackend(endpoint: EndpointReference): KubernetesIngressResource
method withForwardedHeaders builder
Configures whether forwarded headers processing is enabled for the Aspire dashboard container.
withForwardedHeaders(enabled?: boolean): KubernetesAspireDashboardResource
method withGatewayAnnotation builder
Adds a Kubernetes metadata annotation to the generated Gateway resource.
withGatewayAnnotation(key: string, value: string): KubernetesGatewayResource
method withGatewayAnnotationParam builder
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withGatewayAnnotationParam(key: string, value: ParameterResource): KubernetesGatewayResource
method withGatewayClass builder
Sets the GatewayClass name that selects which controller implementation handles this gateway.
withGatewayClass(className: string): KubernetesGatewayResource
method withGatewayClassParam builder
Sets the GatewayClass name using a parameter that will be resolved at deploy time.
withGatewayClassParam(className: ParameterResource): KubernetesGatewayResource
method withGatewayHostnameParam builder
Adds a hostname using a parameter that will be resolved at deploy time.
withGatewayHostnameParam(hostname: ParameterResource): KubernetesGatewayResource
method withGatewayHostRoute builder
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.
withGatewayHostRoute(host: string, path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResource
method withGatewayPathRoute builder
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.
withGatewayPathRoute(path: string, endpoint: EndpointReference, pathType?: GatewayPathMatchType): KubernetesGatewayResource
method withGatewayTlsAuto builder
Configures TLS termination with an auto-generated secret name derived from the gateway name.
withGatewayTlsAuto(): KubernetesGatewayResource
method withGatewayTlsIssuer builder
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.
withGatewayTlsIssuer(issuer: CertManagerIssuerResource): KubernetesGatewayResource
method withGatewayTlsParam builder
Configures TLS termination using a parameter for the secret name.
withGatewayTlsParam(secretName: ParameterResource): KubernetesGatewayResource
method withHelm builder
Configures the Kubernetes environment to deploy using Helm charts.
withHelm(configure?: (obj: HelmChartOptions) => Promise<void>): KubernetesEnvironmentResource
method withHelmChartDestroy builder
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.
withHelmChartDestroy(): KubernetesHelmChartResource
method withHelmChartForceConflicts builder
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.
withHelmChartForceConflicts(): KubernetesHelmChartResource
method withHelmChartNamespace builder
Sets the Kubernetes namespace for the Helm chart installation. If not set, the namespace defaults to the chart resource name.
withHelmChartNamespace(namespace: string): KubernetesHelmChartResource
method withHelmChartReleaseName builder
Sets the Helm release name for the chart installation. If not set, the release name defaults to the resource name.
withHelmChartReleaseName(releaseName: string): KubernetesHelmChartResource
method withHelmValue builder
Sets a Helm value for the chart installation. Values are passed to `helm upgrade --install` via `--set` flags.
withHelmValue(key: string, value: string): KubernetesHelmChartResource
method withHostname builder
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(hostname: string): KubernetesGatewayResource
method withHostname builder
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.
withHostname(hostname: string): KubernetesIngressResource
method withHttp01Solver builder
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.
withHttp01Solver(): CertManagerIssuerResource
method withIngressAnnotation builder
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.
withIngressAnnotation(key: string, value: string): KubernetesIngressResource
method withIngressAnnotationParam builder
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withIngressAnnotationParam(key: string, value: ParameterResource): KubernetesIngressResource
method withIngressClass builder
Sets the Kubernetes ingress class name that selects which ingress controller handles this ingress resource.
withIngressClass(className: string): KubernetesIngressResource
method withIngressClassParam builder
Sets the Kubernetes ingress class name using a parameter that will be resolved at deploy time.
withIngressClassParam(className: ParameterResource): KubernetesIngressResource
method withIngressHostAndPath builder
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.
withIngressHostAndPath(host: string, path: string, endpoint: EndpointReference, pathType?: IngressPathType): KubernetesIngressResource
method withIngressHostnameParam builder
Adds a hostname using a parameter that will be resolved at deploy time.
withIngressHostnameParam(hostname: ParameterResource): KubernetesIngressResource
method withIngressPath builder
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.
withIngressPath(path: string, endpoint: EndpointReference, pathType?: IngressPathType): KubernetesIngressResource
method withIngressTlsAuto builder
Configures TLS termination with an auto-generated secret name derived from the ingress name.
withIngressTlsAuto(): KubernetesIngressResource
method withIngressTlsParam builder
Configures TLS termination using a parameter for the secret name.
withIngressTlsParam(secretName: ParameterResource): KubernetesIngressResource
method withLetsEncryptProduction builder
Configures the issuer to use the Let's Encrypt production ACME endpoint.
withLetsEncryptProduction(email: string): CertManagerIssuerResource
method withLetsEncryptProductionParam builder
Configures the issuer to use the Let's Encrypt production ACME endpoint, with the contact email supplied via a parameter resolved at deploy time.
withLetsEncryptProductionParam(email: ParameterResource): CertManagerIssuerResource
method withLetsEncryptStaging builder
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.
withLetsEncryptStaging(email: string): CertManagerIssuerResource
method withLetsEncryptStagingParam builder
Configures the issuer to use the Let's Encrypt staging ACME endpoint, with the contact email supplied via a parameter resolved at deploy time.
withLetsEncryptStagingParam(email: ParameterResource): CertManagerIssuerResource
method withNodePool builder
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.
withNodePool(nodePool: KubernetesNodePoolResource): IResource
method withOtlpServicePort builder
Sets the Kubernetes Service ports for the Aspire Dashboard OTLP endpoints.
withOtlpServicePort(grpcPort?: number, httpPort?: number): KubernetesAspireDashboardResource
method withProperties builder
Allows setting the properties of a Kubernetes environment resource.
withProperties(configure: (obj: KubernetesEnvironmentResource) => Promise<void>): KubernetesEnvironmentResource
method withServicePort builder
Sets the Kubernetes Service port for the Aspire Dashboard HTTP endpoint.
withServicePort(port?: number): KubernetesAspireDashboardResource
method withTls builder
Configures TLS on a Kubernetes Gateway listener
withTls(secretName: string): KubernetesGatewayResource
method withTls builder
Configures TLS for a Kubernetes Ingress using a K8S secret
withTls(secretName: string): KubernetesIngressResource

Enums