Aspire.Hosting.Kubernetes
Official
📦 Aspire.Hosting.Kubernetesv13.4.0-preview.1.26281.1852Functions
13Types
13 types and 29 members
Types
handle
CertManagerIssuerResource7 membershandle
CertManagerResource1 membershandle
HelmChartOptions5 membershandle
KubernetesAspireDashboardResource5 membershandle
KubernetesEnvironmentResource25 membershandle
KubernetesGatewayResource12 membershandle
KubernetesHelmChartResource5 membershandle
KubernetesIngressResource12 membershandle
KubernetesManifestResource4 membershandle
KubernetesNodePoolResourcehandle
KubernetesResource2 membersFunctions
method
addCertManagerbuilderInstalls cert-manager into a Kubernetes environment
addCertManager(name: string, chartVersion?: string): CertManagerResourcemethod
addGatewaybuilderAdds 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): KubernetesGatewayResourcemethod
addHelmChartbuilderAdds 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): KubernetesHelmChartResourcemethod
addIngressbuilderAdds 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): KubernetesIngressResourcemethod
addIssuerbuilderAdds a cert-manager `ClusterIssuer` to this cert-manager installation.
addIssuer(name: string): CertManagerIssuerResourcemethod
addKubernetesEnvironmentbuilderAdds a Kubernetes environment to the application model.
addKubernetesEnvironment(name: string): KubernetesEnvironmentResourcemethod
addNodePoolbuilderAdds a named node pool to the Kubernetes environment.
addNodePool(name: string): KubernetesNodePoolResourcemethod
configureDashboardbuilderConfigures the dashboard properties for this Kubernetes environment.
configureDashboard(configure: (obj: KubernetesAspireDashboardResource) => Promise<void>): KubernetesEnvironmentResourcemethod
publishAsKubernetesServicebuilderPublishes the specified resource as a Kubernetes service.
publishAsKubernetesService(configure: (obj: KubernetesResource) => Promise<void>): IComputeResourcemethod
withAcmeServerbuilderConfigures 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): CertManagerIssuerResourcemethod
withAcmeServerParambuilderConfigures the issuer to use a custom ACME directory endpoint with a parameterized email.
withAcmeServerParam(serverUrl: string, email: ParameterResource): CertManagerIssuerResourcemethod
withDashboardbuilderEnables the Aspire dashboard for telemetry visualization in this Kubernetes environment.
withDashboard(enabled?: boolean): KubernetesEnvironmentResourcemethod
withDefaultBackendbuilderSets the default backend for the ingress. The default backend handles requests that do not match any of the defined routing rules.
withDefaultBackend(endpoint: EndpointReference): KubernetesIngressResourcemethod
withForwardedHeadersbuilderConfigures whether forwarded headers processing is enabled for the Aspire dashboard container.
withForwardedHeaders(enabled?: boolean): KubernetesAspireDashboardResourcemethod
withGatewayAnnotationbuilderAdds a Kubernetes metadata annotation to the generated Gateway resource.
withGatewayAnnotation(key: string, value: string): KubernetesGatewayResourcemethod
withGatewayAnnotationParambuilderAdds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withGatewayAnnotationParam(key: string, value: ParameterResource): KubernetesGatewayResourcemethod
withGatewayClassbuilderSets the GatewayClass name that selects which controller implementation handles this gateway.
withGatewayClass(className: string): KubernetesGatewayResourcemethod
withGatewayClassParambuilderSets the GatewayClass name using a parameter that will be resolved at deploy time.
withGatewayClassParam(className: ParameterResource): KubernetesGatewayResourcemethod
withGatewayHostnameParambuilderAdds a hostname using a parameter that will be resolved at deploy time.
withGatewayHostnameParam(hostname: ParameterResource): KubernetesGatewayResourcemethod
withGatewayHostRoutebuilderAdds 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): KubernetesGatewayResourcemethod
withGatewayPathRoutebuilderAdds 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): KubernetesGatewayResourcemethod
withGatewayTlsAutobuilderConfigures TLS termination with an auto-generated secret name derived from the gateway name.
withGatewayTlsAuto(): KubernetesGatewayResourcemethod
withGatewayTlsIssuerbuilderAdds 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): KubernetesGatewayResourcemethod
withGatewayTlsParambuilderConfigures TLS termination using a parameter for the secret name.
withGatewayTlsParam(secretName: ParameterResource): KubernetesGatewayResourcemethod
withHelmbuilderConfigures the Kubernetes environment to deploy using Helm charts.
withHelm(configure?: (obj: HelmChartOptions) => Promise<void>): KubernetesEnvironmentResourcemethod
withHelmChartDestroybuilderOpts 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(): KubernetesHelmChartResourcemethod
withHelmChartForceConflictsbuilderOpts 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(): KubernetesHelmChartResourcemethod
withHelmChartNamespacebuilderSets the Kubernetes namespace for the Helm chart installation. If not set, the namespace defaults to the chart resource name.
withHelmChartNamespace(namespace: string): KubernetesHelmChartResourcemethod
withHelmChartReleaseNamebuilderSets the Helm release name for the chart installation. If not set, the release name defaults to the resource name.
withHelmChartReleaseName(releaseName: string): KubernetesHelmChartResourcemethod
withHelmValuebuilderSets a Helm value for the chart installation. Values are passed to `helm upgrade --install` via `--set` flags.
withHelmValue(key: string, value: string): KubernetesHelmChartResourcemethod
withHostnamebuilderAdds 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): KubernetesGatewayResourcemethod
withHostnamebuilderAdds 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): KubernetesIngressResourcemethod
withHttp01SolverbuilderAdds 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(): CertManagerIssuerResourcemethod
withIngressAnnotationbuilderAdds 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): KubernetesIngressResourcemethod
withIngressAnnotationParambuilderAdds a Kubernetes metadata annotation with a parameter value that will be resolved at deploy time.
withIngressAnnotationParam(key: string, value: ParameterResource): KubernetesIngressResourcemethod
withIngressClassbuilderSets the Kubernetes ingress class name that selects which ingress controller handles this ingress resource.
withIngressClass(className: string): KubernetesIngressResourcemethod
withIngressClassParambuilderSets the Kubernetes ingress class name using a parameter that will be resolved at deploy time.
withIngressClassParam(className: ParameterResource): KubernetesIngressResourcemethod
withIngressHostAndPathbuilderAdds 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): KubernetesIngressResourcemethod
withIngressHostnameParambuilderAdds a hostname using a parameter that will be resolved at deploy time.
withIngressHostnameParam(hostname: ParameterResource): KubernetesIngressResourcemethod
withIngressPathbuilderAdds 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): KubernetesIngressResourcemethod
withIngressTlsAutobuilderConfigures TLS termination with an auto-generated secret name derived from the ingress name.
withIngressTlsAuto(): KubernetesIngressResourcemethod
withIngressTlsParambuilderConfigures TLS termination using a parameter for the secret name.
withIngressTlsParam(secretName: ParameterResource): KubernetesIngressResourcemethod
withLetsEncryptProductionbuilderConfigures the issuer to use the Let's Encrypt production ACME endpoint.
withLetsEncryptProduction(email: string): CertManagerIssuerResourcemethod
withLetsEncryptProductionParambuilderConfigures 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): CertManagerIssuerResourcemethod
withLetsEncryptStagingbuilderConfigures 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): CertManagerIssuerResourcemethod
withLetsEncryptStagingParambuilderConfigures 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): CertManagerIssuerResourcemethod
withNodePoolbuilderSchedules 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): IResourcemethod
withOtlpServicePortbuilderSets the Kubernetes Service ports for the Aspire Dashboard OTLP endpoints.
withOtlpServicePort(grpcPort?: number, httpPort?: number): KubernetesAspireDashboardResourcemethod
withPropertiesbuilderAllows setting the properties of a Kubernetes environment resource.
withProperties(configure: (obj: KubernetesEnvironmentResource) => Promise<void>): KubernetesEnvironmentResourcemethod
withServicePortbuilderSets the Kubernetes Service port for the Aspire Dashboard HTTP endpoint.
withServicePort(port?: number): KubernetesAspireDashboardResourcemethod
withTlsbuilderConfigures TLS on a Kubernetes Gateway listener
withTls(secretName: string): KubernetesGatewayResourcemethod
withTlsbuilderConfigures TLS for a Kubernetes Ingress using a K8S secret
withTls(secretName: string): KubernetesIngressResource