Watch Aspire live streamsDocsTry Aspire

addServiceEndpoint

Method
📦 CommunityToolkit.Aspire.Hosting.K3s v13.5.0
interface K3sClusterResource {
// ... omitted for brevity
addServiceEndpoint(
name: string,
serviceName: string,
servicePort: number,
namespace?: string,
scheme?: string): K3sServiceEndpointResource;
}

Signature

methodaddServiceEndpointbuilder
Exposes a Kubernetes Service from the cluster as an Aspire endpoint resource.
addServiceEndpoint(
name: string,
serviceName: string,
servicePort: number,
namespace?: string,
scheme?: string): K3sServiceEndpointResource
namestringThe Aspire resource name for this endpoint.
serviceNamestringThe name of the Kubernetes Service to forward, as it appears in `kubectl get svc`.
servicePortnumberThe port number declared on the Kubernetes Service (the `port` field, not `targetPort`). Must be in the range 1–65535.
namespacestringoptional= defaultThe Kubernetes namespace that contains the Service. Defaults to `default`.
schemestringoptionalThe URL scheme (`http` or `https`) for the injected environment variable. When `null` (the default), the scheme is inferred from the port: ports 443 and 8443 use `https`, all others use `http`.
K3sServiceEndpointResource

Applies to

This method applies to the following types: