Skip to content
DocsTry Aspire
DocsTry

K3sAgentResource

Classsealednet10.0
📦 CommunityToolkit.Aspire.Hosting.K3s v13.4.1-beta.706
Represents a k3s agent (worker) node belonging to a K3sClusterResource.
namespace Aspire.Hosting.ApplicationModel;
public sealed class K3sAgentResource
: Aspire.Hosting.ApplicationModel.ContainerResource,
Aspire.Hosting.ApplicationModel.IResource,
Aspire.Hosting.ApplicationModel.IResourceWithParent,
Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.ApplicationModel.K3sClusterResource>
{
// ...
}
ContainerResourceIResourceIResourceWithParentIResourceWithParent<K3sClusterResource>
Agent nodes run k3s agent and join the server at https://{serverName}:6443 using DCP's Docker DNS. They start in parallel with the server without a WaitFor dependency — k3s's built-in retry loop handles the connection timing. The cluster's health check waits for all 1 + AgentCount nodes to reach Ready state before the cluster resource transitions to Running. Agent nodes are created automatically by AddK3sCluster when K3sClusterOptions.AgentCount is greater than zero.