Skip to content
DocsTry Aspire
DocsTry

K3sServiceEndpointResource

Classsealednet10.0
📦 CommunityToolkit.Aspire.Hosting.K3s v13.4.1-beta.706
Represents a Kubernetes Service exposed from a k3s cluster as an Aspire endpoint resource.
namespace Aspire.Hosting.ApplicationModel;
public sealed class K3sServiceEndpointResource
: Aspire.Hosting.ApplicationModel.Resource,
Aspire.Hosting.ApplicationModel.IExpressionValue,
Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
Aspire.Hosting.ApplicationModel.IResource,
Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
Aspire.Hosting.ApplicationModel.IResourceWithParent,
Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.ApplicationModel.K3sClusterResource>,
Aspire.Hosting.ApplicationModel.IResourceWithWaitSupport,
Aspire.Hosting.ApplicationModel.IValueProvider,
Aspire.Hosting.ApplicationModel.IValueWithReferences
{
// ...
}
ResourceIExpressionValueIManifestExpressionProviderIResourceIResourceWithConnectionStringIResourceWithParentIResourceWithParent<K3sClusterResource>IResourceWithWaitSupportIValueProviderIValueWithReferences
An in-process WebSocket port-forward bridges the cluster service to a host port when the cluster is ready. Dependent resources receive the service URL via the standard Aspire service-discovery environment variable services__{name}__url:
  • Host processes receive http(s)://localhost:{port}.
  • Containers receive http(s)://host.docker.internal:{port}.
Use WaitFor(endpoint) on dependent resources to ensure the port-forward is active before they start.