addK3sCluster

Method
📦 CommunityToolkit.Aspire.Hosting.K3s v13.6.1
interface IDistributedApplicationBuilder {
// ... omitted for brevity
addK3sCluster(
name: string,
apiServerPort?: number,
agentCount?: number): K3sClusterResource;
}

Signature

methodaddK3sClusterbuilder
Adds a k3s Kubernetes cluster to the distributed application.
addK3sCluster(
name: string,
apiServerPort?: number,
agentCount?: number): K3sClusterResource
namestringThe resource name. Also used as the DNS hostname by which containers in the DCP network reach the cluster's API server (e.g. `https://{name}:6443`).
apiServerPortnumberoptionalHost port to bind the Kubernetes API server (port 6443) to. When `null` (the default) a random available port is assigned.
agentCountnumberoptionalNumber of k3s agent (worker) nodes to add. When `null` (the default) a single-node cluster is created — the server node acts as both control-plane and worker. Equivalent to calling `WithAgentCount` on the returned builder.
K3sClusterResource

Applies to

This method applies to the following types: