Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

AddK3sCluster

Method
📦 CommunityToolkit.Aspire.Hosting.K3s v13.6.1
func (DistributedApplicationBuilder) AddK3sCluster(
name string,
options ...*AddK3sClusterOptions,
) K3sClusterResource

Signature

methodAddK3sClusterbuilder
Adds a k3s Kubernetes cluster to the distributed application.
AddK3sCluster(
name string,
options ...*AddK3sClusterOptions,
) 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).
options...*AddK3sClusterOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*AddK3sClusterOptions argument.

ApiServerPort*float64Host port to bind the Kubernetes API server (port 6443) to. When null (the default) a random available port is assigned.
AgentCount*float64Number 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

A builder for the K3sClusterResource.

Returns a handle; failures surface later via Err().

Applies to

This method applies to the following types:

typeDistributedApplicationBuilder