K3sServiceEndpointResource
Classsealednet10.0
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
9 members
Remarks
Section titled Remarks 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}.
WaitFor(endpoint) on dependent resources to ensure the port-forward is active before they start. Constructors1
Section titled ConstructorsProperties7
Section titled PropertiesConnectionStringEnvironmentVariablegetstring? The environment variable name used to inject the service URL into dependents (
services__{name}__url), following the Aspire service-discovery convention. ConnectionStringExpressiongetReferenceExpression Gets the manifest expression for the service URL. Resolves to
http(s)://localhost:{hostPort} when the endpoint is ready. HostPortgetint Gets the host port bound by the port-forward listener.
NamespacegetstringGets the Kubernetes namespace that contains the Service.
Parentget Gets the parent resource of type
K3sClusterResource. ServiceNamegetstringGets the name of the Kubernetes Service being forwarded.
ServicePortgetintGets the port number declared on the Kubernetes Service.