Skip to content
DocsTry Aspire
DocsTry

Aspire.Hosting.Kubernetes

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

Types

Functions

methodaddCertManagerbuilder
Installs cert-manager into a Kubernetes environment
addCertManager(name: string, chartVersion?: string): CertManagerResource
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
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
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
methodaddIssuerbuilder
Adds a cert-manager `ClusterIssuer` to this cert-manager installation.
addIssuer(name: string): CertManagerIssuerResource
methodaddKubernetesEnvironmentbuilder
Adds a Kubernetes environment to the application model.
addKubernetesEnvironment(name: string): KubernetesEnvironmentResource
methodaddNodePoolbuilder
Adds a named node pool to the Kubernetes environment.
addNodePool(name: string): KubernetesNodePoolResource
methodconfigureDashboardbuilder
Configures the dashboard properties for this Kubernetes environment.
configureDashboard(configure: (obj: KubernetesAspireDashboardResource) => Promise<void>): KubernetesEnvironmentResource
methodpublishAsKubernetesServicebuilder
Publishes the specified resource as a Kubernetes service.
publishAsKubernetesService(configure: (obj: KubernetesResource) => Promise<void>): IComputeResource
methodwithAcmeServerbuilder
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
methodwithAcmeServerParambuilder
Configures the issuer to use a custom ACME directory endpoint with a parameterized email.
withAcmeServerParam(serverUrl: string, email: ParameterResource): CertManagerIssuerResource
methodwithDashboardbuilder
Enables the Aspire dashboard for telemetry visualization in this Kubernetes environment.
withDashboard(enabled?: boolean): KubernetesEnvironmentResource
methodwithDefaultBackendbuilder
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
methodwithForwardedHeadersbuilder
Configures whether forwarded headers processing is enabled for the Aspire dashboard container.
withForwardedHeaders(enabled?: boolean): KubernetesAspireDashboardResource
methodwithGatewayAnnotationbuilder
Adds a Kubernetes metadata annotation to the generated Gateway resource.
withGatewayAnnotation(key: string, value: string): KubernetesGatewayResource
methodwithGatewayAnnotationParambuilder
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withGatewayAnnotationParam(key: string, value: ParameterResource): KubernetesGatewayResource
methodwithGatewayClassbuilder
Sets the GatewayClass name that selects which controller implementation handles this gateway.
withGatewayClass(className: string): KubernetesGatewayResource
methodwithGatewayClassParambuilder
Sets the GatewayClass name using a parameter that will be resolved at deploy time.
withGatewayClassParam(className: ParameterResource): KubernetesGatewayResource
methodwithGatewayHostnameParambuilder
Adds a hostname using a parameter that will be resolved at deploy time.
withGatewayHostnameParam(hostname: ParameterResource): KubernetesGatewayResource
methodwithGatewayHostRoutebuilder
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
methodwithGatewayPathRoutebuilder
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
methodwithGatewayTlsAutobuilder
Configures TLS termination with an auto-generated secret name derived from the gateway name.
withGatewayTlsAuto(): KubernetesGatewayResource
methodwithGatewayTlsIssuerbuilder
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
methodwithGatewayTlsParambuilder
Configures TLS termination using a parameter for the secret name.
withGatewayTlsParam(secretName: ParameterResource): KubernetesGatewayResource
methodwithHelmbuilder
Configures the Kubernetes environment to deploy using Helm charts.
withHelm(configure?: (obj: HelmChartOptions) => Promise<void>): KubernetesEnvironmentResource
methodwithHelmChartDestroybuilder
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
methodwithHelmChartForceConflictsbuilder
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
methodwithHelmChartNamespacebuilder
Sets the Kubernetes namespace for the Helm chart installation. If not set, the namespace defaults to the chart resource name.
withHelmChartNamespace(namespace: string): KubernetesHelmChartResource
methodwithHelmChartReleaseNamebuilder
Sets the Helm release name for the chart installation. If not set, the release name defaults to the resource name.
withHelmChartReleaseName(releaseName: string): KubernetesHelmChartResource
methodwithHelmValuebuilder
Sets a Helm value for the chart installation. Values are passed to `helm upgrade --install` via `--set` flags.
withHelmValue(key: string, value: string): KubernetesHelmChartResource
methodwithHostnamebuilder
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
methodwithHostnamebuilder
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
methodwithHttp01Solverbuilder
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
methodwithIngressAnnotationbuilder
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
methodwithIngressAnnotationParambuilder
Adds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withIngressAnnotationParam(key: string, value: ParameterResource): KubernetesIngressResource
methodwithIngressClassbuilder
Sets the Kubernetes ingress class name that selects which ingress controller handles this ingress resource.
withIngressClass(className: string): KubernetesIngressResource
methodwithIngressClassParambuilder
Sets the Kubernetes ingress class name using a parameter that will be resolved at deploy time.
withIngressClassParam(className: ParameterResource): KubernetesIngressResource
methodwithIngressHostAndPathbuilder
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
methodwithIngressHostnameParambuilder
Adds a hostname using a parameter that will be resolved at deploy time.
withIngressHostnameParam(hostname: ParameterResource): KubernetesIngressResource
methodwithIngressPathbuilder
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
methodwithIngressTlsAutobuilder
Configures TLS termination with an auto-generated secret name derived from the ingress name.
withIngressTlsAuto(): KubernetesIngressResource
methodwithIngressTlsParambuilder
Configures TLS termination using a parameter for the secret name.
withIngressTlsParam(secretName: ParameterResource): KubernetesIngressResource
methodwithLetsEncryptProductionbuilder
Configures the issuer to use the Let's Encrypt production ACME endpoint.
withLetsEncryptProduction(email: string): CertManagerIssuerResource
methodwithLetsEncryptProductionParambuilder
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
methodwithLetsEncryptStagingbuilder
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
methodwithLetsEncryptStagingParambuilder
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
methodwithNodePoolbuilder
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
methodwithOtlpServicePortbuilder
Sets the Kubernetes Service ports for the Aspire Dashboard OTLP endpoints.
withOtlpServicePort(grpcPort?: number, httpPort?: number): KubernetesAspireDashboardResource
methodwithPropertiesbuilder
Allows setting the properties of a Kubernetes environment resource.
withProperties(configure: (obj: KubernetesEnvironmentResource) => Promise<void>): KubernetesEnvironmentResource
methodwithServicePortbuilder
Sets the Kubernetes Service port for the Aspire Dashboard HTTP endpoint.
withServicePort(port?: number): KubernetesAspireDashboardResource
methodwithTlsbuilder
Configures TLS on a Kubernetes Gateway listener
withTls(secretName: string): KubernetesGatewayResource
methodwithTlsbuilder
Configures TLS for a Kubernetes Ingress using a K8S secret
withTls(secretName: string): KubernetesIngressResource

Enums