# K3sServiceEndpointResource

- Module: [CommunityToolkit.Aspire.Hosting.K3s](/reference/api/go/communitytoolkit.aspire.hosting.k3s.md)
- Version: `13.6.1`
- Kind: `handle`
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Represents a Kubernetes Service exposed from a k3s cluster as an Aspire endpoint resource.

## 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`:
-
-
Use `WaitFor(endpoint)` on dependent resources to ensure the port-forward is active
before they start.

## Definition

```go
type K3sServiceEndpointResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
    ResourceWithParent
    ResourceWithWaitSupport
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`
- `ResourceWithParent`
- `ResourceWithWaitSupport`

## Properties

- `ConnectionStringEnvironmentVariable`: `*string` `get` -- The environment variable name used to inject the service URL into dependents (`services__{name}__url`), following the Aspire service-discovery convention.
- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the manifest expression for the service URL. Resolves to `http(s)://localhost:{hostPort}` when the endpoint is ready.
- `HostPort`: `float64` `get/set` -- Gets the host port bound by the port-forward listener.
- `Namespace`: `string` `get` -- Gets the Kubernetes namespace that contains the Service.
- `Parent`: [`K3sClusterResource`](/reference/api/go/communitytoolkit.aspire.hosting.k3s/k3sclusterresource.md) `get` -- Gets the Parent property
- `ServiceName`: `string` `get` -- Gets the name of the Kubernetes Service being forwarded.
- `ServicePort`: `float64` `get` -- Gets the port number declared on the Kubernetes Service.
