K3sBuilderExtensions
Classstaticnet10.0
Provides extension methods for adding k3s cluster resources to an
Hosting.IDistributedApplicationBuilder. namespace Aspire.Hosting;
public static class K3sBuilderExtensions{ // ...}11 members
Methods11
Section titled MethodsAddK3sCluster(IDistributedApplicationBuilder, string, int?, int?)extensionats exportIResourceBuilder<K3sClusterResource> Adds a k3s Kubernetes cluster to the distributed application.
WithAgentCount(IResourceBuilder<K3sClusterResource>, int)extensionats exportIResourceBuilder<K3sClusterResource> Sets the number of k3s agent (worker) nodes to add to the cluster.
WithDataVolume(IResourceBuilder<K3sClusterResource>, string?)extensionats exportIResourceBuilder<K3sClusterResource> Mounts a named Docker volume at the k3s data directory so cluster state persists across AppHost restarts.
WithDisabledComponent(IResourceBuilder<K3sClusterResource>, string)extensionats exportIResourceBuilder<K3sClusterResource> Disables a built-in k3s component (
--disable=<component>). WithExtraArg(IResourceBuilder<K3sClusterResource>, string)extensionats exportIResourceBuilder<K3sClusterResource> Appends a raw argument to the
k3s server command line. WithHelmImage(IResourceBuilder<K3sClusterResource>, string?, string?, string?)extensionats exportIResourceBuilder<K3sClusterResource> Overrides the container image used to run
helm upgrade --install for all HelmReleaseResource children of this cluster. WithK3sVersion(IResourceBuilder<K3sClusterResource>, string)extensionats exportIResourceBuilder<K3sClusterResource> Sets the k3s image version used by the cluster server and all its agent nodes.
WithKubectlImage(IResourceBuilder<K3sClusterResource>, string?, string?, string?)extensionats exportIResourceBuilder<K3sClusterResource> Overrides the container image used to run
kubectl apply for all K8sManifestResource children of this cluster. WithLifetime(IResourceBuilder<K3sClusterResource>, ContainerLifetime)extensionats exportIResourceBuilder<K3sClusterResource> Sets the container lifetime for the k3s cluster and all its agent nodes.
WithPodSubnet(IResourceBuilder<K3sClusterResource>, string)extensionats exportIResourceBuilder<K3sClusterResource> Sets the CIDR range for pod IP addresses (
--cluster-cidr). WithServiceSubnet(IResourceBuilder<K3sClusterResource>, string)extensionats exportIResourceBuilder<K3sClusterResource> Sets the CIDR range for Service cluster IPs (
--service-cidr).